Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 10 Jan 2018 21:17:50 -0500
From: Rich Felker <dalias@...c.org>
To: Peter Wang <novalazy@...il.com>
Cc: musl@...ts.openwall.com
Subject: Re: alternative form flag with zero octal value

On Wed, Jan 10, 2018 at 09:02:46PM -0500, Rich Felker wrote:
> On Thu, Jan 11, 2018 at 11:43:05AM +1100, Peter Wang wrote:
> > Hi,
> > 
> > I'm not certain it is a bug, but this program produces "00" instead of "0":
> > 
> >     #include <stdio.h>
> >     int main(void)
> >     {
> >         printf("%#o\n", 0);
> >         return 0;
> >     }
> > 
> > Please Cc: any replies as I am not subscribed to this list.
> 
> Indeed, this is a bug. I'm not sure whether it was introduced in
> commit 78897b0dc00b7cd5c29af5e0b7eebf2396d8dce0 or already present,
> but it was not present in Dmitry Levin's original more complex version
> of the patch. I'm going to essentially revert this commit and replace
> it with an alternate one-line fix using infrastructure that wasn't
> available at the time but added later in commit
> 167dfe9672c116b315e72e57a55c7769f180dffa.
> 
> Thanks for the report.

Here's the patch I'm going to push if I don't find any problems with
it.

Rich

View attachment "0001-fix-printf-alt-form-octal-with-value-0-and-no-explic.patch" of type "text/plain" (1832 bytes)

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.