[libc] fix strtointeger hex prefix parsing
authorMichael Jones <michaelrj@google.com>
Wed, 1 Sep 2021 20:09:29 +0000 (20:09 +0000)
committerMichael Jones <michaelrj@google.com>
Fri, 3 Sep 2021 20:39:15 +0000 (20:39 +0000)
commit37ce7349f7e95ef19cd6169e70414286b33114cb
tree3f548bbd41a021f364f8d30c4983ea0227195598
parenteee1f1c8fb0242de4eac53867b4446052e3bb8d3
[libc] fix strtointeger hex prefix parsing

Fix edge case where "0x" would be considered a complete hexadecimal
number for purposes of str_end. Now the hexadecimal prefix needs a valid
digit after it, else just the 0 will be counted as the number.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D109084
libc/src/__support/str_conv_utils.h
libc/test/src/stdlib/strtol_test.cpp
libc/test/src/stdlib/strtoll_test.cpp
libc/test/src/stdlib/strtoul_test.cpp
libc/test/src/stdlib/strtoull_test.cpp