diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-05-04 04:01:45 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-05-04 04:01:45 +0200 |
commit | ac1b4bcbaeaee7d2ef9132dcdc254f2d08691650 (patch) | |
tree | 90250966629653f0462cf17bc0b6f2476fb6d1fc /lib/mbstring/u8hassfx.c | |
parent | 8b923ba5e5bb37ea26350b4c1c688b8697706609 (diff) |
Go all in on string views, and fix manuals
Diffstat (limited to 'lib/mbstring/u8hassfx.c')
-rw-r--r-- | lib/mbstring/u8hassfx.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); } |