svn commit: r285552 - head/usr.bin/xargs

Julian Elischer julian at freebsd.org
Wed Jul 15 07:32:20 UTC 2015


On 7/15/15 8:02 AM, Xin Li wrote:
> -----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
>>>> <bapt at FreeBSD.org> 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.
does it cover 0100 and 0x100?



More information about the svn-src-head mailing list