making scanf byte-clean(er)

Andy Koppe
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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: scanf.patch
Type: application/octet-stream
Size: 3464 bytes
Desc: not available
URL: <>

More information about the Cygwin-patches mailing list