qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Magnus Reftel <reftel@spotify.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] linux-user: Let user specify random seed
Date: Fri, 10 Oct 2014 10:20:22 -0600	[thread overview]
Message-ID: <54380746.50307@redhat.com> (raw)
In-Reply-To: <CAP5XVJMwwF3P-yy0f4tD+J=B0PRxi4--Bq6_2kUP7cdo8KErtA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 830 bytes --]

On 10/10/2014 02:16 AM, Magnus Reftel wrote:
> On Thu, Oct 9, 2014 at 11:30 PM, Eric Blake <eblake@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)

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.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-10-10 16:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09 19:12 [Qemu-devel] [PATCH v3] linux-user: Let user specify random seed Magnus Reftel
2014-10-09 19:12 ` [Qemu-devel] [PATCH] " Magnus Reftel
2014-10-09 21:30   ` Eric Blake
2014-10-10  8:16     ` Magnus Reftel
2014-10-10 16:20       ` Eric Blake [this message]
2014-10-14  9:46         ` Magnus Reftel
  -- strict thread matches above, loose matches on Subject: below --
2014-10-14 15:18 [Qemu-devel] [PATCH v5] " Magnus Reftel
2014-10-14 15:18 ` [Qemu-devel] [PATCH] " Magnus Reftel
2014-10-14  9:50 [Qemu-devel] [PATCH v4] " Magnus Reftel
2014-10-14  9:50 ` [Qemu-devel] [PATCH] " Magnus Reftel
2014-10-14 15:07   ` Eric Blake
2014-10-09  8:36 [Qemu-devel] [PATCH v2] " Magnus Reftel
2014-10-09  8:36 ` [Qemu-devel] [PATCH] " Magnus Reftel
2014-10-09 15:27   ` Eric Blake
2014-10-09 19:10     ` Magnus Reftel
2014-10-08 12:13 [Qemu-devel] [PATCH] Let user specify random seed for linux-user Magnus Reftel
2014-10-08 12:13 ` [Qemu-devel] [PATCH] linux-user: Let user specify random seed Magnus Reftel
2014-10-08 14:45   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54380746.50307@redhat.com \
    --to=eblake@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=reftel@spotify.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).