witnessmenow/spotify-api-arduino

Should not use sprintf with the same source and buffer

witnessmenow opened this issue · 0 comments

From Boulkan on Discord:

sprintf(command, command, position);

@brian L You tested it, so it works. But I doubt this is fool-proof for all C-implementations. @bitbank 💾Mr. Optimization any 2 cents?

citation: "However, the standards explicitly note that the results are undefined if source and destination buffers overlap"

But this is pointed to the overlap between the destination buffer (first command) and the variable (position). And the format is constant, so.... Just wondering.