From ac1b4bcbaeaee7d2ef9132dcdc254f2d08691650 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sat, 4 May 2024 04:01:45 +0200 Subject: Go all in on string views, and fix manuals --- lib/mbstring/u8hassfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/mbstring/u8hassfx.c') diff --git a/lib/mbstring/u8hassfx.c b/lib/mbstring/u8hassfx.c index e31bb4b..8ea4456 100644 --- a/lib/mbstring/u8hassfx.c +++ b/lib/mbstring/u8hassfx.c @@ -4,7 +4,7 @@ #include "mbstring.h" bool -u8hassfx(const char8_t *s, size_t n, const char8_t *sfx, size_t m) +u8hassfx(struct u8view sv, struct u8view sfx) { - return n >= m && memeq(s + n - m, sfx, m); + return sv.len >= sfx.len && memeq(sv.p + sv.len - sfx.len, sfx.p, sfx.len); } -- cgit v1.2.3