]> Git Repo - qemu.git/commit
qemu-nbd: Avoid strtol open-coding
authorEric Blake <[email protected]>
Thu, 17 Jan 2019 19:36:44 +0000 (13:36 -0600)
committerEric Blake <[email protected]>
Mon, 21 Jan 2019 21:49:51 +0000 (15:49 -0600)
commit43b510113bb2c6393c98a31dae9b57022a9c5636
tree652a6194aae4111fc432159691cfc315fb0acbbc
parent9d26dfcbab62746b3e66ec7784d75c13ff499669
qemu-nbd: Avoid strtol open-coding

Our copy-and-pasted open-coding of strtol handling forgot to
handle overflow conditions.  Use qemu_strto*() instead.

In the case of --partition, since we insist on a user-supplied
partition to be non-zero, we can use 0 rather than -1 for our
initial value to distinguish when a partition is not being
served, for slightly more optimal code.

The error messages for out-of-bounds values are less specific,
but should not be a terrible loss in quality.

Signed-off-by: Eric Blake <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Richard W.M. Jones <[email protected]>
Message-Id: <20190117193658[email protected]>
qemu-nbd.c
This page took 0.028245 seconds and 4 git commands to generate.