aboutsummaryrefslogtreecommitdiff
path: root/text-motions.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-04-09 20:53:08 +0200
committerMarc André Tanner <mat@brain-dump.org>2017-04-09 20:53:08 +0200
commit7530c6411b64c8a4a7790240315628ea94c7a6ba (patch)
tree529413a6192874c88797a3252eea7c67893bd32c /text-motions.c
parentf59bebc98fb19ca5c2a13288f0593395f3c0d6d1 (diff)
downloadvis-7530c6411b64c8a4a7790240315628ea94c7a6ba.tar.gz
vis-7530c6411b64c8a4a7790240315628ea94c7a6ba.tar.xz
text: use MB_LEN_MAX instead of MB_CUR_MAX
Diffstat (limited to 'text-motions.c')
-rw-r--r--text-motions.c5
1 files changed, 3 insertions, 2 deletions
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 <stdlib.h>
#include <wchar.h>
#include <errno.h>
+#include <limits.h>
#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;