This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug in Newlib's sscanf implementation


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

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]