Re: [PATCH 1/4] fast-import: stricter parsing of integer options
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 30, 2010, 01:01 UTC
- Message-ID
- <7vzksrwrnt.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20101128194246.GB19998@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 6 quoted lines
> +static unsigned long ulong_arg(const char *option, const char *arg)
> +{
> + char *endptr;
> + unsigned long rv = strtoul(arg, &endptr, 0);
> + if (strchr(arg, '-') || endptr == arg || *endptr)
> + die("%s: argument must be an unsigned integer", option);Micronit.
It probably is Ok for the target audience, but it might be more proper to call it "non-negative integer" ("unsigned integer" is a container to hold such quantity).