aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-08-25 08:27:47 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-08-25 08:27:47 +0300
commit33f71eb118c81e788cd64049d70c8f79e969f2ac (patch)
tree021d13b3d6dc30f449318ce1107247ff0973a2a8
parentc03ef263ed760700752957ab4dacee0220ad392e (diff)
downloaddico-33f71eb118c81e788cd64049d70c8f79e969f2ac.tar.gz
dico-33f71eb118c81e788cd64049d70c8f79e969f2ac.tar.bz2
Bugfix
* lib/utf8.c (utf8_iter0): Switch to error state if utf8_char_width returned 0
-rw-r--r--lib/utf8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utf8.c b/lib/utf8.c
index a25c613..3653d59 100644
--- a/lib/utf8.c
+++ b/lib/utf8.c
@@ -1542,13 +1542,13 @@ utf8_iter0(struct utf8_iterator *itr)
1542 1542
1543 if (itr->length == 0) { 1543 if (itr->length == 0) {
1544 itr->end = 1; 1544 itr->end = 1;
1545 return 1; 1545 return 1;
1546 } 1546 }
1547 n = utf8_char_width(itr->curptr); 1547 n = utf8_char_width(itr->curptr);
1548 if (n > itr->length) { 1548 if (n == 0 || n > itr->length) {
1549 itr->end = 1; 1549 itr->end = 1;
1550 itr->err = 1; 1550 itr->err = 1;
1551 return 1; 1551 return 1;
1552 } 1552 }
1553 1553
1554 itr->curwidth = n; 1554 itr->curwidth = n;

Return to:

Send suggestions and report system problems to the System administrator.