Re: [PATCH v2 17/19] cutils: Use parse_uint in qemu_strtosz for negative rejection

2023-05-19 Thread Hanna Czenczek
On 12.05.23 21:34, Eric Blake wrote: On Thu, May 11, 2023 at 09:10:31PM -0500, Eric Blake wrote: Rather than open-coding two different ways to check for an unwanted negative sign, reuse the same code in both functions. That way, if we decide down the road to accept "-0" instead of rejecting it,

Re: [PATCH v2 17/19] cutils: Use parse_uint in qemu_strtosz for negative rejection

2023-05-12 Thread Eric Blake
On Thu, May 11, 2023 at 09:10:31PM -0500, Eric Blake wrote: > > Rather than open-coding two different ways to check for an unwanted > negative sign, reuse the same code in both functions. That way, if we > decide down the road to accept "-0" instead of rejecting it, we have > fewer places to ch

[PATCH v2 17/19] cutils: Use parse_uint in qemu_strtosz for negative rejection

2023-05-11 Thread Eric Blake
Rather than open-coding two different ways to check for an unwanted negative sign, reuse the same code in both functions. That way, if we decide down the road to accept "-0" instead of rejecting it, we have fewer places to change. Also, it means we now get ERANGE instead of EINVAL for negative va