diff --git a/lib/json/json.hpp b/lib/json/json.hpp
index fb52a265..3f5c2b19 100644
--- a/lib/json/json.hpp
+++ b/lib/json/json.hpp
@@ -2784,7 +2784,7 @@ scan_number_done:
         std::string result;
         for (auto c : s)
         {
-            if (c == '\0' or c == std::char_traits<char>::eof())
+	  if (c == '\0' or ((int)c) == std::char_traits<char>::eof())
             {
                 // ignore EOF
                 continue;