aboutsummaryrefslogtreecommitdiff
path: root/lib/mbstring/u8next.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mbstring/u8next.c')
-rw-r--r--lib/mbstring/u8next.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/mbstring/u8next.c b/lib/mbstring/u8next.c
index 82d2ad7..518de49 100644
--- a/lib/mbstring/u8next.c
+++ b/lib/mbstring/u8next.c
@@ -1,16 +1,15 @@
#include "mbstring.h"
int
-u8next(rune *ch, const char8_t **s, size_t *n)
+u8next(rune *ch, struct u8view *sv)
{
- rune _;
- int m = 0;
+ int n = 0;
- if (*n) {
- m = u8tor(ch ? ch : &_, *s);
- *n -= m;
- *s += m;
+ if (sv->len) {
+ rune _;
+ n = u8tor(ch ? ch : &_, sv->p);
+ VSHFT(sv, n);
}
- return m;
+ return n;
}