mirror of
https://github.com/HowardHinnant/date.git
synced 2025-08-03 12:44:27 +02:00
Cast to unsigned char
before calling toupper()
(#648)
This commit is contained in:
@@ -4779,7 +4779,7 @@ scan_keyword(std::basic_istream<CharT, Traits>& is, FwdIter kb, FwdIter ke)
|
|||||||
is.setstate(std::ios::eofbit);
|
is.setstate(std::ios::eofbit);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
auto c = static_cast<char>(toupper(ic));
|
auto c = static_cast<char>(toupper(static_cast<unsigned char>(ic)));
|
||||||
bool consume = false;
|
bool consume = false;
|
||||||
// For each keyword which might match, see if the indx character is c
|
// For each keyword which might match, see if the indx character is c
|
||||||
// If a match if found, consume c
|
// If a match if found, consume c
|
||||||
@@ -4792,7 +4792,7 @@ scan_keyword(std::basic_istream<CharT, Traits>& is, FwdIter kb, FwdIter ke)
|
|||||||
{
|
{
|
||||||
if (*st == might_match)
|
if (*st == might_match)
|
||||||
{
|
{
|
||||||
if (c == static_cast<char>(toupper((*ky)[indx])))
|
if (c == static_cast<char>(toupper(static_cast<unsigned char>((*ky)[indx]))))
|
||||||
{
|
{
|
||||||
consume = true;
|
consume = true;
|
||||||
if (ky->size() == indx+1)
|
if (ky->size() == indx+1)
|
||||||
|
Reference in New Issue
Block a user