This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH] Don't accept exp char without digits in scanf float parsing


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


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