mirror of
https://github.com/HowardHinnant/date.git
synced 2024-12-27 00:14:07 +08:00
Cast to unsigned char
before calling toupper()
(#648)
This commit is contained in:
parent
bf79dd5a81
commit
1c285d6545
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user