Date: Tue, 14 Mar 2006 18:49:05 +0100 From: Andre Oppermann <andre@freebsd.org> To: Andrey Chernov <ache@FreeBSD.ORG> Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdlib Makefile.inc Symbol.map strtonum.3 strtonum.c src/include stdlib.h Message-ID: <44170211.573E2112@freebsd.org> References: <200603141657.k2EGvU0p071401@repoman.freebsd.org> <20060314172556.GA63170@nagual.pp.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
Andrey Chernov wrote: > > On Tue, Mar 14, 2006 at 04:57:30PM +0000, Andre Oppermann wrote: > > andre 2006-03-14 16:57:30 UTC > > > > FreeBSD src repository > > > > Modified files: > > lib/libc/stdlib Makefile.inc Symbol.map > > include stdlib.h > > Added files: > > lib/libc/stdlib strtonum.3 strtonum.c > > Log: > > Import of OpenBSD's strtonum(3) which is a nicer version of strtoll(3) > > providing proper error checking and other improvements. > > Error checking isn't so proper as said. > > if (numstr == ep || *ep != '\0') > > must be > > if (numstr == ep || *ep != '\0' || errno == EINVAL) >From my reading there is no case of EINVAL which would not be catched by (numstr == ep || *ep != '\0'). However OpenBSD's strtoll(3) never returns EINVAL in the first place. > I'll commit this, if no objections. I agree that this extra check makes things more clear and will catch errors properly should our strtoll(3) ever be changed. Please commit. -- Andre
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44170211.573E2112>