aboutsummaryrefslogtreecommitdiff
path: root/wtf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'wtf8.c')
-rw-r--r--wtf8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/wtf8.c b/wtf8.c
index e277d1a..714a7cc 100644
--- a/wtf8.c
+++ b/wtf8.c
@@ -35,7 +35,7 @@ void print_characters(char *s) {
/*
* We need a short counter to find how long each character is
*/
- int c;
+ unsigned char c;
/*
* Iterate through the string
@@ -46,7 +46,7 @@ void print_characters(char *s) {
* Print blanks and increment a counter until we find how long this
* character is
*/
- for (c = 1; is_utf8_cont(s[c]); c++)
+ for (c = 1; is_utf8_cont(s[c]) && c <= UCHAR_MAX; c++)
printf(" ");
/*