[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: Let user specify random seed
From: |
Magnus Reftel |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: Let user specify random seed |
Date: |
Tue, 14 Oct 2014 11:46:09 +0200 |
On Fri, Oct 10, 2014 at 6:20 PM, Eric Blake <address@hidden> wrote:
> On 10/10/2014 02:16 AM, Magnus Reftel wrote:
>> On Thu, Oct 9, 2014 at 11:30 PM, Eric Blake <address@hidden> 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)
>
> No, the whole point of using parse_uint_full() instead of parse_uint()
> is that parse_uint_full() has one less parameter and enforces no
> trailing garbage on your behalf.
Right, missed the "_full". Sending an updated patch.
BR
Magnus Reftel