diff options
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | wtf8.c | 4 | ||||
-rw-r--r-- | wtf8.h | 1 |
3 files changed, 4 insertions, 3 deletions
@@ -1 +1 @@ -1.2.0 +1.2.1 @@ -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(" "); /* @@ -1,3 +1,4 @@ +#include <limits.h> #include <stdio.h> #include <stdlib.h> |