making scanf byte-clean(er)

Andy Koppe andy.koppe@gmail.com
Sun Jan 10 19:39:00 GMT 2010


Attached is a patch for making the scanf format string (more)
byte-transparent. It actually couldn't deal with non-ASCII chars at
all, even valid ones, due to comparing an 'unsigned char' with a
(signed) 'char'. And when encountering an invalid byte, it would go
backwards in the format string. Finally, it wrongly reset the
multibyte conversion state for every character and used the same state
object for the format string and %ls arguments.

I thought I'd send the patch here for review first before sending it
upstream. Hope that makes sense.

Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scanf.patch
Type: application/octet-stream
Size: 3464 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20100110/3780f22f/attachment.obj>


More information about the Cygwin-patches mailing list