Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 10 Sep 2018 00:30:50 +0300 (MSK)
From: Alexander Monakov <amonakov@...ras.ru>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] simplify __procfdname by folding the 0 case

On Sun, 9 Sep 2018, Fāng-ruì Sòng wrote:
> > > -     for (; fd; fd/=10) buf[--i] = '0' + fd%10;
> > > +     for (j=fd; i++, j /= 10; );
> >
> > This is not correct as it only increments i once. A do-while loop would do
> > the
> > job better here.
> >
> 
> May I defend for myself?  for (j=fd; i++, j /= 10; );
> i++ is in the loop condition so it will be incremented multiple times.

Sorry, my mistake there (I misread the change).

Alexander

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.