summaryrefslogtreecommitdiffstats
path: root/src/bfstd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bfstd.c')
-rw-r--r--src/bfstd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bfstd.c b/src/bfstd.c
index 2d9f60a..61d2fee 100644
--- a/src/bfstd.c
+++ b/src/bfstd.c
@@ -666,9 +666,9 @@ static size_t printable_len(const char *str, size_t len, enum wesc_flags flags)
multibyte:
memset(&mb, 0, sizeof(mb));
- while (i < len) {
+ for (size_t j = i; i < len; i = j) {
wchar_t wc;
- if (xmbrtowc(&wc, &i, str, len, &mb) != 0) {
+ if (xmbrtowc(&wc, &j, str, len, &mb) != 0) {
break;
}
if (!xiswprint(wc, flags)) {