This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Don't accept exp char without digits in scanf float parsing
- From: Rich Felker <dalias at aerifal dot cx>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: Andreas Schwab <schwab at suse dot de>, libc-alpha at sourceware dot org
- Date: Wed, 10 Apr 2013 13:51:12 -0400
- Subject: Re: [PATCH] Don't accept exp char without digits in scanf float parsing
- References: <mvmeheizir3 dot fsf at hawking dot suse dot de> <20130410172642 dot 865F82C07E at topped-with-meat dot com>
On Wed, Apr 10, 2013 at 10:26:42AM -0700, Roland McGrath wrote:
> Can you reformulate the test case to be just one sscanf call?
Not possible. The first scanf is required to stop on the first
non-matching conversion specifier. The second one is used to check
what character was left unread. Of course getc could be used instead
of scanf for the second call.
Rich