From owner-cvs-all@FreeBSD.ORG Tue Mar 14 17:49:13 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.ORG Delivered-To: cvs-all@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F02F16A424 for ; Tue, 14 Mar 2006 17:49:13 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 42C8C43D75 for ; Tue, 14 Mar 2006 17:49:03 +0000 (GMT) (envelope-from andre@freebsd.org) Received: (qmail 72036 invoked from network); 14 Mar 2006 17:46:28 -0000 Received: from c00l3r.networx.ch (HELO freebsd.org) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 14 Mar 2006 17:46:28 -0000 Message-ID: <44170211.573E2112@freebsd.org> Date: Tue, 14 Mar 2006 18:49:05 +0100 From: Andre Oppermann X-Mailer: Mozilla 4.8 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Andrey Chernov References: <200603141657.k2EGvU0p071401@repoman.freebsd.org> <20060314172556.GA63170@nagual.pp.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Mar 2006 17:49:13 -0000 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