From 1c285d654525b8fec157116419fa43233ff7e8d3 Mon Sep 17 00:00:00 2001 From: Davis Vaughan Date: Wed, 24 Feb 2021 12:49:46 -0500 Subject: [PATCH] Cast to `unsigned char` before calling `toupper()` (#648) --- include/date/date.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/date/date.h b/include/date/date.h index 1ad5424..73e95dc 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -4779,7 +4779,7 @@ scan_keyword(std::basic_istream& is, FwdIter kb, FwdIter ke) is.setstate(std::ios::eofbit); break; } - auto c = static_cast(toupper(ic)); + auto c = static_cast(toupper(static_cast(ic))); bool consume = false; // For each keyword which might match, see if the indx character is c // If a match if found, consume c @@ -4792,7 +4792,7 @@ scan_keyword(std::basic_istream& is, FwdIter kb, FwdIter ke) { if (*st == might_match) { - if (c == static_cast(toupper((*ky)[indx]))) + if (c == static_cast(toupper(static_cast((*ky)[indx])))) { consume = true; if (ky->size() == indx+1)