• M
    util/cutils: Let qemu_strtosz*() optionally reject trailing crap · 4fcdf65a
    Markus Armbruster 提交于
    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 <dgilbert@redhat.com>
    Cc: Eduardo Habkost <ehabkost@redhat.com> (maintainer:X86)
    Cc: Kevin Wolf <kwolf@redhat.com> (supporter:Block layer core)
    Cc: Max Reitz <mreitz@redhat.com> (supporter:Block layer core)
    Cc: qemu-block@nongnu.org (open list:Block layer core)
    Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
    Reviewed-by: NEric Blake <eblake@redhat.com>
    Reviewed-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
    Message-Id: <1487708048-2131-22-git-send-email-armbru@redhat.com>
    4fcdf65a
hmp.c 78.3 KB