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: Dr. David Alan Gilbert
Subject: Re: [Qemu-devel] [PATCH 21/24] util/cutils: Let qemu_strtosz*() optionally reject trailing crap
Date: Tue, 21 Feb 2017 09:21:06 +0000
User-agent: Mutt/1.7.1 (2016-10-04)

* Markus Armbruster (address@hidden) wrote:
> "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?

Oh I wouldn't worry too much about it; and those perhaps aren't
that much clearer.

Dave

--
Dr. David Alan Gilbert / address@hidden / Manchester, UK



reply via email to

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