Re: [PATCH 2/2] Support sizes >=2G in various config options accepting 'g' sizes.
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Sep 6, 2011, 10:22 UTC
- Message-ID
- <4E65F451.4070900@viscovery.net>
- In-Reply-To
- <87ty8qjaof.fsf@spindle.srvr.nix>
Am 9/6/2011 11:13, schrieb Nix:
> ... amounts to writing our own strtol() > specifically for this one case, to see if the parsed number is > too long.
Why so? strtol() can report overflow:
RETURN VALUE
...
If the correct value is outside the range of representable values,
{LONG_MIN}, {LONG_MAX}, {LLONG_MIN}, or {LLONG_MAX} shall be returned
(according to the sign of the value), and errno set to [ERANGE].-- Hannes