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.
This commit is contained in:
Jonathan Wakely 2021-05-05 11:19:55 +01:00
parent 0bd8a9ef70
commit d0d6ca0197

View File

@ -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
{