GLibc sscanf bug

Andreas Schwab schwab@suse.de
Sat Jun 19 16:34:00 GMT 2004


wasik <wasik@broumovska.lbcfree.net> writes:

> I think the second line should be -1 as the line does not match defined
> format of sscanf.

Not a bug.  %d matches +2, so 2 it is assigned to pl.  Then matching %%
against the next character fails and scanf returns.  There is no way to
find out the exact position where matching stopped between conversion
specifications.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Libc-alpha mailing list