summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2023-12-12 21:19:52 +1100
committerMaxime Coste <mawww@kakoune.org>2023-12-12 21:19:52 +1100
commit5ed2433b9f06e80cc76cb97b43302efa65b74df3 (patch)
tree6ed9023da0f38fe92aa3ea46515a40abf0b48dd7 /src
parent7b2772ef8988b8b4a24b57638cecf5ff00fe5219 (diff)
parenta8d5b8bd2c8846bc996aed70434a4f0c488c1cc6 (diff)
Merge remote-tracking branch 'arachsys/unsigned-char'
Diffstat (limited to 'src')
-rw-r--r--src/json.cc4
-rw-r--r--src/terminal_ui.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/json.cc b/src/json.cc
index 82fc0f28..7323e2fe 100644
--- a/src/json.cc
+++ b/src/json.cc
@@ -20,7 +20,7 @@ String to_json(StringView str)
for (auto it = str.begin(), end = str.end(); it != end; )
{
auto next = std::find_if(it, end, [](char c) {
- return c == '\\' or c == '"' or (c >= 0 and c <= 0x1F);
+ return c == '\\' or c == '"' or (unsigned char) c <= 0x1F;
});
res += StringView{it, next};
@@ -28,7 +28,7 @@ String to_json(StringView str)
break;
char buf[7] = {'\\', *next, 0};
- if (*next >= 0 and *next <= 0x1F)
+ if ((unsigned char) *next <= 0x1F)
format_to(buf, "\\u{:04}", hex(*next));
res += buf;
diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc
index 62df5aa7..db967976 100644
--- a/src/terminal_ui.cc
+++ b/src/terminal_ui.cc
@@ -30,8 +30,8 @@ static String fix_atom_text(StringView str)
auto pos = str.begin();
for (auto it = str.begin(), end = str.end(); it != end; ++it)
{
- char c = *it;
- if (c >= 0 and c <= 0x1F)
+ unsigned char c = *it;
+ if (c <= 0x1F)
{
res += StringView{pos, it};
res += String{Codepoint{(uint32_t)(0x2400 + c)}};