Hi! On Wed, Dec 01, 2004 at 12:29:58PM +0100, Spiro Trikaliotis wrote: > Yes, I know. In fact, sprintf() has many other problems, too. I have not > checked, but cc65 does not happen to have an snprintf() function? (I'm > curious to see the first exploit for a 6502 computer...) snprintf is C99, this is the reason why I didn't bother to implement it. Adding it wouldn't be a big deal anyway, minor changes (if any) in the basic _printf function would be needed. > Well, my question was: Does the standard guarantee that *only* strings > and character literals are converted? I fear some compilers trying to > convert the contents of a char variable (for example, if I use the above > sprintf(), my 0x01 would be translated!) I don't know of any statement in the standard that allows translation of arbitrary numerical values. The reason why character and string literals can be translated is that the standard defines a "source character set" and an "execution character set". The representation of the execution character set using characters of the source character set in string and character literals is implementation defined. Regards Uz -- Ullrich von Bassewitz uz@musoftware.de ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo@musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.Received on Wed Dec 1 12:48:11 2004
This archive was generated by hypermail 2.1.8 : 2004-12-01 12:48:20 CET