aboutsummaryrefslogtreecommitdiff
path: root/lib/mbstring
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-10-30 08:28:15 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-10-30 08:28:15 +0100
commit045f4bb5b1767140c4f6cfe2d2002553925c4205 (patch)
treef51b2034e91a3f67d2bde506cf84d13cfc496c6e /lib/mbstring
parent5dbf53a1c512f9163744874e3d502e9f9e2808da (diff)
Make string view lengths signed
Diffstat (limited to 'lib/mbstring')
-rw-r--r--lib/mbstring/u8chr.c2
-rw-r--r--lib/mbstring/u8rchr.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/mbstring/u8chr.c b/lib/mbstring/u8chr.c
index 5ddcdd8..4006ce5 100644
--- a/lib/mbstring/u8chr.c
+++ b/lib/mbstring/u8chr.c
@@ -79,7 +79,7 @@ u8chr(u8view_t sv, rune ch)
char8_t buf[U8_LEN_MAX];
int m = rtou8(buf, sizeof(buf), ch);
- if (sv.len < (size_t)m)
+ if (sv.len < m)
return nullptr;
switch (m) {
case 1:
diff --git a/lib/mbstring/u8rchr.c b/lib/mbstring/u8rchr.c
index 47eaa4c..0ed9f9e 100644
--- a/lib/mbstring/u8rchr.c
+++ b/lib/mbstring/u8rchr.c
@@ -69,7 +69,7 @@ u8rchr(u8view_t sv, rune ch)
char8_t buf[U8_LEN_MAX];
int n = rtou8(buf, ch, sizeof(buf));
- if (sv.len < (size_t)n)
+ if (sv.len < n)
return nullptr;
switch (n) {
case 1: