aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-05-05 11:19:55 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-05-05 12:50:45 +0100
commitd0d6ca019717305df0ef41e3fe1da48f7f561fac (patch)
tree1f4a7a7a8d4d4abe76a31af46dcc5c103c910c58
parent0bd8a9ef70e5461b68f1ec34a4fbee3eb7021510 (diff)
downloadgcc-d0d6ca019717305df0ef41e3fe1da48f7f561fac.zip
gcc-d0d6ca019717305df0ef41e3fe1da48f7f561fac.tar.gz
gcc-d0d6ca019717305df0ef41e3fe1da48f7f561fac.tar.bz2
libstdc++: Use unsigned char argument to std::isdigit
Passing plain char to isdigit is undefined if the value is negative. libstdc++-v3/ChangeLog: * include/std/charconv (__from_chars_alnum): Pass unsigned char to std::isdigit.
-rw-r--r--libstdc++-v3/include/std/charconv2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/charconv b/libstdc++-v3/include/std/charconv
index 193702e..571be07 100644
--- a/libstdc++-v3/include/std/charconv
+++ b/libstdc++-v3/include/std/charconv
@@ -565,7 +565,7 @@ namespace __detail
while (__first != __last)
{
unsigned char __c = *__first;
- if (std::isdigit(__c))
+ if (std::isdigit(static_cast<unsigned char>(__c)))
__c -= '0';
else
{