David Hildenbrand af02f4c517 cutils: Fix qemu_strtosz() & friends to reject non-finite sizes
qemu_strtosz() & friends reject NaNs, but happily accept infinities.
They shouldn't. Fix that.

The fix makes use of qemu_strtod_finite(). To avoid ugly casts,
change the @end parameter of qemu_strtosz() & friends from char **
to const char **.

Also, add two test cases, testing that "inf" and "NaN" are properly
rejected. While at it, also fixup the function documentation.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181121164421.20780-3-david@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-12-13 19:10:06 +01:00
..
2018-10-29 13:35:22 +00:00
2018-09-25 15:50:15 +02:00
2018-10-02 18:47:55 +02:00
2018-10-02 18:47:55 +02:00
2018-10-29 16:23:17 -04:00
2018-06-01 16:01:29 +01:00
2018-10-02 18:47:55 +02:00
2018-10-02 18:47:55 +02:00
2018-10-02 18:47:55 +02:00
2018-08-24 20:26:37 +02:00
2018-06-29 12:32:10 +02:00