From 7530c6411b64c8a4a7790240315628ea94c7a6ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 9 Apr 2017 20:53:08 +0200 Subject: text: use MB_LEN_MAX instead of MB_CUR_MAX --- text-motions.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'text-motions.c') diff --git a/text-motions.c b/text-motions.c index 6221f31..4dd7b89 100644 --- a/text-motions.c +++ b/text-motions.c @@ -3,6 +3,7 @@ #include #include #include +#include #include "text-motions.h" #include "text-util.h" #include "util.h" @@ -191,7 +192,7 @@ int text_line_width_get(Text *txt, size_t pos) { Iterator it = text_iterator_get(txt, bol); while (it.pos < pos) { - char buf[MB_CUR_MAX]; + char buf[MB_LEN_MAX]; size_t len = text_bytes_get(txt, it.pos, sizeof buf, buf); if (len == 0 || buf[0] == '\n') break; @@ -228,7 +229,7 @@ size_t text_line_width_set(Text *txt, size_t pos, int width) { Iterator it = text_iterator_get(txt, bol); for (;;) { - char buf[MB_CUR_MAX]; + char buf[MB_LEN_MAX]; size_t len = text_bytes_get(txt, it.pos, sizeof buf, buf); if (len == 0 || buf[0] == '\n') break; -- cgit v1.2.3