Date: Tue, 5 Sep 2017 00:00:46 +0200 From: Bartosz Brachaczek <b.brachaczek@...il.com> To: musl@...ts.openwall.com Subject: Re: [PATCH] handle whitespace before %% in scanf On 7/10/2017 4:44 PM, Jens Gustedt wrote: > Hello Bartosz, > > On Mon, 10 Jul 2017 10:22:37 +0200 Bartosz Brachaczek > <b.brachaczek@...il.com> wrote: > >>> EXAMPLE 5 The call: >>> >>> #include <stdio.h> >>> /* ... */ >>> int n, i; >>> n = sscanf("foo % bar 42", "foo%%bar%d", &i); >>> >>> will assign to 'n' the value 1 and to 'i' the value 42 because input >>> white-space characters are skipped for both the '%' and 'd' >>> conversion specifiers. >> >> Now, the code in the example is clearly broken, as either the format >> string should be "foo%% bar%d" or the input string should be >> "foo %bar 42", but the explanation does imply that '%%' consumes >> whitespace. > > Yes, I have noted this as an editorial fix for C17 > > Thanks for reporting Nice, thanks. Looks this one has already been reported here: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2033.htm I can't find what's the status of that document, though.
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.