[libc-commits] [PATCH] D112176: [libc] fix strtol returning the wrong length
Michael Jones via Phabricator via libc-commits
libc-commits at lists.llvm.org
Wed Oct 20 14:15:46 PDT 2021
michaelrj added inline comments.
================
Comment at: libc/src/__support/str_conv_utils.h:83
+ seen_digit = true;
+ }
+
----------------
sivachandra wrote:
> Do we need this `if` block at all?
it's to handle the case where the number is just "0" and the base is set to automatic. Without this, then that would be parsed as an octal number with no digits, as opposed to a decimal number with one digit. I've added a test to check this.
The other part of the condition was unnecessary though.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112176/new/
https://reviews.llvm.org/D112176
More information about the libc-commits
mailing list