From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11904 Path: news.gmane.org!.POSTED!not-for-mail From: Bartosz Brachaczek Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] handle whitespace before %% in scanf Date: Tue, 5 Sep 2017 00:00:46 +0200 Message-ID: <545322d4-6607-360a-2319-6266b5517224@gmail.com> References: <20170709210018.16369-1-b.brachaczek@gmail.com> <20170710020047.GL1627@brightrain.aerifal.cx> <20170710164445.53ef621d@inria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1504562482 18691 195.159.176.226 (4 Sep 2017 22:01:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 4 Sep 2017 22:01:22 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 To: musl@lists.openwall.com Original-X-From: musl-return-11917-gllmg-musl=m.gmane.org@lists.openwall.com Tue Sep 05 00:01:08 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dozQN-0003b9-JW for gllmg-musl@m.gmane.org; Tue, 05 Sep 2017 00:00:55 +0200 Original-Received: (qmail 13458 invoked by uid 550); 4 Sep 2017 22:01:00 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 13437 invoked from network); 4 Sep 2017 22:00:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=8inqAAwGqNHXToc9roGVr1eG8RrcNUz4XAW/pXPc00E=; b=MjwfuL090RKvbTvJgRxgo8rcJy+3Oc2DnAZZMo2XIiAFW4nl2re4ANWI6MzVKox661 dJ1NuJ9z0kbJdtU7nKOq9PFoziFCIeW/G7l4g9+Ue4HsmgumRETeni7FHgyh8Q1DNPV5 QoLDo+0nGGFwDHBLuahnBt0pNQWyWPjiyuvGqwP3s2r8SBeEGdJJmMeZ6hgDbXKCCxVJ LX+ilyufMdsz08bCDutEF0bncDrNsZC+NQup/f4YSy9PkevPW4WpfCQGlMMIFMT4e8iE VK3MtZaCIR1gUSV8oedC2814IGeDJQJy3erBs93rm/c66utp9MWHhoZeG/pVQ3JohBIk JgWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8inqAAwGqNHXToc9roGVr1eG8RrcNUz4XAW/pXPc00E=; b=tXckryFhjJXB1HBve4dAfSCy29c0CW5GbsJbVeYWvIjnTf417bg0ZKSVeehMvCHi7V W6MCVEDeOGsdIexyOdURqbmhPrNeP1ucLWXjTLAqsiFRFq8jMoAa/1m33lzJN3jJLNW8 JrOkQ0eN4K8CNAH4q7FTMNcVA4HH3o6Vt4xI9N0C3k3MNuhbmEMaOaNrcKAPbGLn/9FN E7jZ+4P/RC2wBRk9W5Mn2fIRidhsa9Uil/hM8YczkJk8wMgVXpK+0YM6Hlt9t75N2c04 keKhCNt4YNUZ/muiCQQO2tzuV5X/1v/RJDPUm11U49KfuhaKHt0F8Kl0i6SUxyuKMMiv yoJA== X-Gm-Message-State: AHPjjUh2Q8FGsIaKl0/GieBf0wvWfc8peepkJJ1ghXpRXU7FwBtTqTCI ZaXm69YNsLAHMxtykfg= X-Google-Smtp-Source: ADKCNb4nBTVg3oWJYVZTn6UsiYaeE+Ok4pQ07TuLsFdsnZkUsDlTsQB+x1OKyVz8SBMug2xsowAF0g== X-Received: by 10.223.158.146 with SMTP id a18mr944169wrf.333.1504562448289; Mon, 04 Sep 2017 15:00:48 -0700 (PDT) In-Reply-To: <20170710164445.53ef621d@inria.fr> Content-Language: en-US Xref: news.gmane.org gmane.linux.lib.musl.general:11904 Archived-At: On 7/10/2017 4:44 PM, Jens Gustedt wrote: > Hello Bartosz, > > On Mon, 10 Jul 2017 10:22:37 +0200 Bartosz Brachaczek > wrote: > >>> EXAMPLE 5 The call: >>> >>> #include >>> /* ... */ >>> 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.