qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 21/24] util/cutils: Let qemu_strtosz*() optional


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 21/24] util/cutils: Let qemu_strtosz*() optionally reject trailing crap
Date: Tue, 21 Feb 2017 10:13:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

"Dr. David Alan Gilbert" <address@hidden> writes:

> * Markus Armbruster (address@hidden) wrote:
>> Change the qemu_strtosz() & friends to return -EINVAL when @endptr is
>> null and the conversion doesn't consume the string completely.
>> Matches how qemu_strtol() & friends work.
>> 
>> Only test_qemu_strtosz_simple() passes a null @endptr.  No functional
>> change there, because its conversion consumes the string.
>> 
>> Simplify callers that use @endptr only to fail when it doesn't point
>> to '\0' to pass a null @endptr instead.
>> 
>> Cc: Dr. David Alan Gilbert <address@hidden>
>> Cc: Eduardo Habkost <address@hidden> (maintainer:X86)
>> Cc: Kevin Wolf <address@hidden> (supporter:Block layer core)
>> Cc: Max Reitz <address@hidden> (supporter:Block layer core)
>> Cc: address@hidden (open list:Block layer core)
>> Signed-off-by: Markus Armbruster <address@hidden>
>
> Reviewed-by: Dr. David Alan Gilbert <address@hidden>
>
> (end and endptr are horribly confusing names in do_strtosz)

Could rename for consistency with qemu_strtol() & friends:

* Parameter @end to @endptr

* Local variable @endptr to @ep

Would that be useful?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]