From owner-svn-src-head@freebsd.org Wed Jul 15 00:02:23 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B082F9A1D0B; Wed, 15 Jul 2015 00:02:23 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 983041C98; Wed, 15 Jul 2015 00:02:23 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from zeta.ixsystems.com (unknown [12.229.62.2]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 4C0091C740; Tue, 14 Jul 2015 17:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1436918543; x=1436932943; bh=7j1/R+DAhP9A485AAimMboqFpm7Ao4NuVvnE+Xx/I9U=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=i3h+UhKgdvaZSEnkMJ3LXLnVRXuKceEvhfXpEG03WALr7JhGp7nwQU/Sw3BPmaKkc WV8E93t7UDdzZhmqc9kkK/Am2wl4NodkOt+1aZqVGreCYCHXYoZgy4G/LKSJ1sauTL xrokyUHSxkUixEpWMLj0iSHR+fGjp4BmJpAWTrns= Message-ID: <55A5A30F.4070005@delphij.net> Date: Tue, 14 Jul 2015 17:02:23 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Ian Lepore , d@delphij.net CC: Garrett Cooper , Baptiste Daroussin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r285552 - head/usr.bin/xargs References: <201507141916.t6EJGEG1083928@repo.freebsd.org> <48222CD1-7087-4C9A-A586-71F6A37A601C@gmail.com> <55A574BA.4090700@delphij.net> <1436912270.1334.309.camel@freebsd.org> In-Reply-To: <1436912270.1334.309.camel@freebsd.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 00:02:23 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 07/14/15 15:17, Ian Lepore wrote: > On Tue, 2015-07-14 at 13:44 -0700, Xin Li wrote: >> On 07/14/15 13:29, Garrett Cooper wrote: >>> On Jul 14, 2015, at 12:16, Baptiste Daroussin >>> wrote: >>> >>>> Author: bapt Date: Tue Jul 14 19:16:14 2015 New Revision: >>>> 285552 URL: https://svnweb.freebsd.org/changeset/base/285552 >>>> >>>> Log: Convert atoi(3) to stronum(3) which allows to arguments >>>> and report proper errors to the users >>> >>> Is strtonum preferred over strtoll, etc? >> >> strtonum(3) is a wrapper of strtoll() and provides more >> functionality like range checking, so I think the answer would be >> yes. >> >> Cheers, >> > > Except if we convert all our tools that take numbers on the command > line to use strtonum() then peoples' existing scripts and other > automation that passes 0xWhatever numbers suddenly stop working. > strtonum() seems to be about 2/3 of a good idea. I think the caller has to be calling with 0 or 16 as base to request that behavior? If we are converting from atoi, the base number is a fixed value of 10. My only concern with strtonum() is that it's English only. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1.6 (FreeBSD) iQIcBAEBCgAGBQJVpaMOAAoJEJW2GBstM+nsA9kP/29HyJZXJQbP57/hhZLpCln4 dO9ScoZxsdvrKzeMfxI3/u16vl2Ei5nkiYLga8gfkpqcmsAc11duomJHvq0BHe2j 7Srr8m4CYsk6bp32qaIBCl9weKz5jR56EaMBn6FfplCYlx+5noHIulXdKz5tWJqF IHiHdXUAGCGPLMLVeVatMk02x1VoCwkSvwyZ070COlZMdz0tfKBz5uvren3C/LCq eI6+9cVXYv5fBChW7CHwtcgtFcILmfaYuzWfOm+i87gj0YfMGa8aq8WjHAkC+JzR lW+WRk8RONhbfIg0fJ8PkrGeinNgaiu9mUDH6qmpqM2Zfy68trxVuBNKtI8ygSJz z7BDsP6TsD/+z02cV9C3wuYGx8U117MVBmFT86W1a7II0VXAug0wg/XUTh9xCWaU w52k/ZfFO0ZE4P+cz/NiFco+MXHpn5Q32lmpWBwv1OAVmaImHTZ3IOkO9LdwsbiX 5Bbj6odEACd64WzgorCdIHt7gcWBFxNjLE/NDUw1CqStqEAzkS8Ny//nG0GC5S9q IO+1epMAWnHxsGJC3zBjYOQUgMRdPmRi35yAxuUpa2tccBFIuPRAkrP24rtQhOB/ USB1a75Dlmr4YssrFKi5ir0pEVg/7JmO0mfsR94en3riq+d7+dD4m4tgUe/QPGjo 3ReYZc3VrLgn2ORs9nH/ =VzoB -----END PGP SIGNATURE-----