diff options
author | Eric Blake <eblake@redhat.com> | 2023-05-22 14:04:30 -0500 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2023-06-02 12:29:27 -0500 |
commit | 52d606aa5b6859bf13b026aa82f53f8506aa6abe (patch) | |
tree | 16c667259935fca2fb4d9b3c58567f6b7f9435f7 /hmp-commands-info.hx | |
parent | bd1386cce1b184e4260721858d3bb4b4c888b5f0 (diff) |
cutils: Allow NULL endptr in parse_uint()
All the qemu_strto*() functions permit a NULL endptr, just like their
libc counterparts, leaving parse_uint() as the oddball that caused
SEGFAULT on NULL and required the user to call parse_uint_full()
instead. Relax things for consistency, even though the testsuite is
the only impacted caller. Add one more unit test to ensure even
parse_uint_full(NULL, 0, &value) works. This also fixes our code to
uniformly favor EINVAL over ERANGE when both apply.
Also fixes a doc mismatch @v vs. a parameter named value.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Hanna Czenczek <hreitz@redhat.com>
Message-Id: <20230522190441.64278-9-eblake@redhat.com>
Diffstat (limited to 'hmp-commands-info.hx')
0 files changed, 0 insertions, 0 deletions