Bug in Newlib's sscanf implementation
Corinna Vinschen
vinschen@redhat.com
Mon Mar 12 13:37:00 GMT 2018
On Mar 9 16:13, Niklas Eklund wrote:
> Hello.
>
> In sscanf with following buffer to parse "0x0000" and format string "%x
> %n", does not return expected result.
>
> It is the value given by %n variable that is off-by-one (value is 5 instead
> of expected 6). The value given by %x is correctly set to zero.
>
> If the buffer to parse is any other value than just zeros, or without
> leading 0x, it gives expected results. I think it might be the
> NDIGITS/NZDIGITS/NNZDIGITS toggling that might throw of the increasing of
> number of characters parsed. Or it is some final criteria that kicks in if
> 0x has been found and then only zeros.
Do you have a patch or at least a self-contained testcase?
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20180312/49585d23/attachment.sig>
More information about the Newlib
mailing list