diff options
Diffstat (limited to 'src/core/wee-utf8.c')
-rw-r--r-- | src/core/wee-utf8.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/wee-utf8.c b/src/core/wee-utf8.c index 2b4108374..04894cb6a 100644 --- a/src/core/wee-utf8.c +++ b/src/core/wee-utf8.c @@ -386,22 +386,19 @@ utf8_char_size_screen (const char *string) } /* - * utf8_add_offset: moves forward N chars in an UTF-8 string + * utf8_add_offset: move forward N chars in an UTF-8 string */ char * utf8_add_offset (const char *string, int offset) { - int count; - if (!string) return NULL; - count = 0; - while (string && string[0] && (count < offset)) + while (string && string[0] && (offset > 0)) { string = utf8_next_char (string); - count++; + offset--; } return (char *)string; } |