aboutsummaryrefslogtreecommitdiff
path: root/lib/mbstring/u8cmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mbstring/u8cmp.c')
-rw-r--r--lib/mbstring/u8cmp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/mbstring/u8cmp.c b/lib/mbstring/u8cmp.c
index 732896c..8bd2400 100644
--- a/lib/mbstring/u8cmp.c
+++ b/lib/mbstring/u8cmp.c
@@ -3,9 +3,7 @@
#include "mbstring.h"
int
-u8cmp(struct u8view x, struct u8view y)
+u8cmp(const char8_t *x, size_t n, const char8_t *y, size_t m)
{
- if (x.len != y.len)
- return x.len > y.len ? +1 : -1;
- return memcmp(x.p, y.p, x.len);
+ return n != m ? (n > m ? +1 : -1) : memcmp(x, y, n);
}