From 33f71eb118c81e788cd64049d70c8f79e969f2ac Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 25 Aug 2019 05:27:47 +0000 Subject: Bugfix * lib/utf8.c (utf8_iter0): Switch to error state if utf8_char_width returned 0 --- diff --git a/lib/utf8.c b/lib/utf8.c index a25c613..3653d59 100644 --- a/lib/utf8.c +++ b/lib/utf8.c @@ -1545,7 +1545,7 @@ utf8_iter0(struct utf8_iterator *itr) return 1; } n = utf8_char_width(itr->curptr); - if (n > itr->length) { + if (n == 0 || n > itr->length) { itr->end = 1; itr->err = 1; return 1; -- cgit v0.9.0.3