From e1133a2dcb3436ac36c75452a569b609cdb58a0b Mon Sep 17 00:00:00 2001 From: 372046933 <372046933@users.noreply.github.com> Date: Thu, 19 Nov 2020 22:21:40 +0800 Subject: [PATCH] std::tolower is undefined if the argument's value is neither representable as unsigned char nor equal to EOF (#761) Co-authored-by: taoxu --- httplib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index c17f340..01081d7 100644 --- a/httplib.h +++ b/httplib.h @@ -271,7 +271,7 @@ struct ci { bool operator()(const std::string &s1, const std::string &s2) const { return std::lexicographical_compare( s1.begin(), s1.end(), s2.begin(), s2.end(), - [](char c1, char c2) { return ::tolower(c1) < ::tolower(c2); }); + [](unsigned char c1, unsigned char c2) { return ::tolower(c1) < ::tolower(c2); }); } };