On Thu, Oct 9, 2014 at 11:30 PM, Eric Blake <ebl...@redhat.com> wrote:
> On 10/09/2014 01:12 PM, Magnus Reftel wrote:
>> +    if (parse_uint(arg, &seed, &end, 0) != 0 || *end != 0 || seed > 
>> UINT_MAX) {
>
> Slightly shorter as:
>
> if (parse_uint_full(arg, &seed, 0) < 0 || seed > UINT_MAX) {
>
> but that's not a functional difference.

That would silently truncate and accept strings containing illegal
characters at the end, e.g. 123a would be treated at 123 (decimal)
while it was likely intended to be 0x123a. Therefore, I suggest to
keep the code as proposed in version 3 of the patch.

BR
Magnus

Reply via email to