fix gcc8 failure, man sprintf:

Some programs imprudently rely on code such as the following
sprintf(buf, "%s some further text", buf);
to append text to buf.  However, the standards explicitly note that the results are undefined if source and destination buffers overlap  when  calling  sprintf(),  snprintf(),  vsprintf(),  and  vs‐
nprintf().  Depending on the version of gcc(1) used, and the compiler options employed, calls such as the above will not produce the expected results.
This commit is contained in:
Philippe Teuwen 2019-10-13 00:31:21 +02:00
parent a41914947a
commit 63711dd312

View file

@ -2262,11 +2262,11 @@ static int CmdT55xxDump(const char *Cmd) {
strcpy (preferredName,"lf-t55xx");
for (uint8_t i = 1; i <= 7; i++) {
if ((cardmem[i].blockdata != 0x00) && (cardmem[i].blockdata != 0xFFFFFFFF))
sprintf (preferredName,"%s-%08X",preferredName,cardmem[i].blockdata);
sprintf (preferredName + strlen(preferredName),"-%08X",cardmem[i].blockdata);
else
break;
}
sprintf (preferredName,"%s-data",preferredName);
strcat (preferredName,"-data");
}
// Swap endian so the files match the txt display