[Bug libc/12701] scanf accepts non-matching input

bugdal at aerifal dot cx sourceware-bugzilla@sourceware.org
Sat Oct 29 21:24:00 GMT 2011


http://sourceware.org/bugzilla/show_bug.cgi?id=12701

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #9 from Rich Felker <bugdal at aerifal dot cx> 2011-10-29 21:24:08 UTC ---
Apparently you only read the first quoted paragraph and not the second:

> > - the input item "0x" is not a matching sequence, so the execution of
> > the whole directive fails;
> 
> Correct

What part of "the execution of the whole directive fails" are you not
understanding? When a directive fails, scanf stops and returns the number of
directives successfully converted and stored. This number is zero, not two. The
%c is never processed. glibc is wrong. Please fix it.

If you insist on keeping compatibility with hypothetical existing binaries that
depend on the wrong behavior, that's what glibc has symbol versioning for...

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list