This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12701] scanf accepts non-matching input
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Sat, 29 Oct 2011 21:24:08 +0000
- Subject: [Bug libc/12701] scanf accepts non-matching input
- Auto-submitted: auto-generated
- References: <bug-12701-131@http.sourceware.org/bugzilla/>
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.