summaryrefslogtreecommitdiff
path: root/src/unicode.c
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2018-07-14 15:01:03 +0300
committerOxore <oxore@protonmail.com>2018-07-14 15:01:03 +0300
commite3614f6eef762ca0c2e14736c8a20760c6d5661b (patch)
treef8834e1137050246bdc99ef476088251707d9917 /src/unicode.c
parentd3fddd7d28f314a6738f2a0ba4d9f58024b01984 (diff)
Add utf8_strlen tests, refactor unicode module
Diffstat (limited to 'src/unicode.c')
-rw-r--r--src/unicode.c4
1 files changed, 2 insertions, 2 deletions
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;