Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 Jan 2005 20:20:00 +0300
From:      Andrey Chernov <ache@nagual.pp.ru>
To:        Thomas Dickey <dickey@radix.net>
Cc:        current@FreeBSD.ORG
Subject:   Re: Implementation errors in strtol()
Message-ID:  <20050122172000.GC39943@nagual.pp.ru>
In-Reply-To: <20050122124032.GA26006@saltmine.radix.net>
References:  <20050121201400.GQ30862@uriah.heep.sax.de> <20050121221156.GA21459@nagual.pp.ru> <20050120192324.GA30862@uriah.heep.sax.de> <20050120205501.GA69123@nagual.pp.ru> <20050120211449.GC30862@uriah.heep.sax.de> <20050120214406.GA70088@nagual.pp.ru> <20050120222137.GE30862@uriah.heep.sax.de> <20050121230949.GA34313@VARK.MIT.EDU> <20050122113015.GV30862@uriah.heep.sax.de> <20050122124032.GA26006@saltmine.radix.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sat, Jan 22, 2005 at 07:40:33AM -0500, Thomas Dickey wrote:
> > Nope.  Just think about it: code which doesn't take this feature into
> > account needs to check for conversion errors by means of verifying
> > endptr.  It simply wouldn't care about errno at all, except for
> 
> That's what I always do - that's the way strtol was first documented.
> Adding errno tweaks on top of that is (as noted) neither portable nor
> necessary.

The story not ends here. After checking endptr you should check for 
overflow, and there you need to consider both cases. See my detailed reply 
to Joerg.

-- 
http://ache.pp.ru/

--ZGiS0Q5IWpPtfppv
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iQCVAwUBQfKLQOJgpPLZnQjrAQGF1QP/TXhEOwTp9IKWk4rMfdy87/Dbdaoz5mIv
nwVOb9irlGcOP6VCBqpUo9asGleV5kVPXaENzliNR+ifwVsG2f8WM76AwhWAWzxX
26u8miXSXl7DP5r170muCft2NakM3AdtHBXV90h9uCy3Q+8EjSAcFnQ9zIXKgXmn
mPS9QOyZ5es=
=PQbv
-----END PGP SIGNATURE-----

--ZGiS0Q5IWpPtfppv--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050122172000.GC39943>