Hi!

On Sun, 2009-03-22 at 13:23:45 +0100, Raphael Hertzog wrote:
> On Fri, 20 Mar 2009, Bill Allombert wrote:
> > > This is easy to fix by checking (s==end), or by setting errno=0 before
> > > calling strto* functions, and checking (errno!=0) afterwards (see the
> > > recently-updated manpage example).  Given enough time, I will
> > > eventually provide a patch for this, but I don't know that I'll get to
> > > it anytime soon..
> > 
> > The attached patch should fix that and is conformant with man strtoul:
> > 
> >        In particular, if *nptr is not '\0' but **endptr is '\0' on return, 
> > the
> >        entire string is valid.
> 
> Your patch doesn't compile:
> ../../src/main.c: In function ‘setinteger’:
> ../../src/main.c:296: error: invalid type argument of ‘unary *’ (have ‘int’)
> make[3]: *** [main.o] Erreur 1
> 
> You added an unwanted "*" in the check. I'll commit it soon after tests.

Before closing this bug, I'd like to get all other instances of strto*
in the source tree reviewed, for this kind of missing checks or other
flacky usage.

regards,
guillem



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to