aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utf8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/utf8.c b/utf8.c
index 0d94c0e..2698f66 100644
--- a/utf8.c
+++ b/utf8.c
@@ -66,7 +66,7 @@ int utf8_strlen(const char *str, int bytelen)
if (bytelen < 0) {
bytelen = strlen(str);
}
- while (bytelen) {
+ while (bytelen > 0) {
int c;
int l = utf8_tounicode(str, &c);
charlen++;