From e3614f6eef762ca0c2e14736c8a20760c6d5661b Mon Sep 17 00:00:00 2001 From: Oxore Date: Sat, 14 Jul 2018 15:01:03 +0300 Subject: Add utf8_strlen tests, refactor unicode module --- src/unicode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/unicode.c') diff --git a/src/unicode.c b/src/unicode.c index dea541a..8bde67d 100644 --- a/src/unicode.c +++ b/src/unicode.c @@ -17,10 +17,10 @@ static inline unsigned int utf8_char_len(unsigned char c) return 0; } -unsigned long utf8_strlen(void *string) +unsigned long utf8_strlen(char *string) { unsigned long len = 0, keep = 0; - for (unsigned char *c = string; *c; (keep ? --keep : ++len), ++c) + for (char *c = string; *c; (keep ? --keep : ++len), ++c) if (!keep) keep = (keep = utf8_char_len(*c)) ? keep - 1 : keep; return len; -- cgit v1.2.3