From ce21edebab86ae4c8f12c21d1f7ad1a9c2fca515 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Fri, 28 Jun 2024 10:14:30 +0100 Subject: [PATCH] Bugfix: char could be signed, check for `> 127` would never succeed --- Sming/Core/Data/Format/Json.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sming/Core/Data/Format/Json.cpp b/Sming/Core/Data/Format/Json.cpp index 3cfaa73aaf..d2f15f46ca 100644 --- a/Sming/Core/Data/Format/Json.cpp +++ b/Sming/Core/Data/Format/Json.cpp @@ -72,7 +72,7 @@ void Json::escape(String& value) const debug_w("Invalid UTF8: %s", value.c_str()); for(unsigned i = 0; i < value.length(); ++i) { char& c = value[i]; - if(c < 0x20 || c > 127) + if(c < 0x20 || uint8_t(c) > 127) c = '_'; } }