From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38639) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xccvf-0000tt-2p for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:20:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XccvY-0004t0-UZ for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:20:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XccvY-0004st-Mm for qemu-devel@nongnu.org; Fri, 10 Oct 2014 12:20:24 -0400 Message-ID: <54380746.50307@redhat.com> Date: Fri, 10 Oct 2014 10:20:22 -0600 From: Eric Blake MIME-Version: 1.0 References: <1412881938-3757-1-git-send-email-reftel@spotify.com> <1412881938-3757-2-git-send-email-reftel@spotify.com> <5436FE5D.7010801@redhat.com> In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H8vGruoQEHR8V7HXBafeFgxHAR8BReCvS" Subject: Re: [Qemu-devel] [PATCH] linux-user: Let user specify random seed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Magnus Reftel Cc: qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --H8vGruoQEHR8V7HXBafeFgxHAR8BReCvS Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/10/2014 02:16 AM, Magnus Reftel wrote: > On Thu, Oct 9, 2014 at 11:30 PM, Eric Blake wrote: >> On 10/09/2014 01:12 PM, Magnus Reftel wrote: >>> + if (parse_uint(arg, &seed, &end, 0) !=3D 0 || *end !=3D 0 || see= d > UINT_MAX) { >> >> Slightly shorter as: >> >> if (parse_uint_full(arg, &seed, 0) < 0 || seed > UINT_MAX) { >> >> but that's not a functional difference. >=20 > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --H8vGruoQEHR8V7HXBafeFgxHAR8BReCvS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUOAdGAAoJEKeha0olJ0Nq7BsH/jCkXEZoZUzaF4+GeBDAVemM 7aGFTudWntAg5R74vGU4JOCSiswUI5OhJ+PmEw0tdEEudV4GMfalxkNZoUhQu7qg MBWyOdo0Mod98UEx9z5ih7y9vO9Ez1xRGL3Q3vlxZMBI+TT9iHjqw/+ZKnX08Sac 1T29l0sM8POWSH4NxO13MZ3VVM4D2EhmgzrSCLW1Q/UvJsojdUfZ8q0oSTRdugpU OVHCapfZK4BhShPXHb7chqKT0Q5KXkt3118sAXjwix5Q0AlZCI6RWVbeke3Odvu4 wwZSjtMLeFoWx0rwlj0elhFAbO5tk/nOBvyRylOr1IHMBMcRg+7kgPwKy2eJjYY= =MOls -----END PGP SIGNATURE----- --H8vGruoQEHR8V7HXBafeFgxHAR8BReCvS--