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-18 19:46:36 -07:00
2018-10-02 18:47:55 +02:00
2017-09-22 14:11:25 +02:00
2018-10-18 19:46:36 -07:00
2017-07-24 12:42:55 +01:00
2016-06-07 18:19:23 +03:00
2017-10-16 20:57:13 +03:00
2016-10-26 08:29:01 -07:00
2017-09-05 22:34:40 +02:00
2018-08-23 18:46:25 +02:00
2018-03-12 11:18:26 +01:00
2018-10-23 10:12:46 +01:00
2016-06-16 18:39:03 +02:00
2018-09-26 08:55:54 -07:00
2018-08-23 18:46:25 +02:00
2018-08-23 18:46:25 +02:00
2018-01-16 14:54:50 +01:00
2018-08-23 18:46:25 +02:00
2017-06-16 07:55:00 +08:00
2016-02-23 12:43:05 +00:00
2018-10-19 19:01:07 +01:00
2018-12-11 15:45:22 -02:00
2018-08-24 20:26:37 +02:00
2016-09-15 15:32:22 +03:00
2017-12-20 22:01:24 +08:00
2018-02-08 09:22:03 +08:00
2017-01-24 23:26:52 +03:00