summaryrefslogtreecommitdiffstats
path: root/misc/bstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc/bstr.c')
-rw-r--r--misc/bstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/bstr.c b/misc/bstr.c
index 7db7015e1c..bb8446d254 100644
--- a/misc/bstr.c
+++ b/misc/bstr.c
@@ -277,7 +277,7 @@ int bstr_decode_utf8(struct bstr s, struct bstr *out_next)
s.start++; s.len--;
if (codepoint >= 128) {
int bytes = bstr_parse_utf8_code_length(codepoint);
- if (bytes < 0 || s.len < bytes - 1)
+ if (bytes < 1 || s.len < bytes - 1)
return -1;
codepoint &= 127 >> bytes;
for (int n = 1; n < bytes; n++) {