summaryrefslogtreecommitdiffstats
path: root/src/bfstd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bfstd.c')
-rw-r--r--src/bfstd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bfstd.c b/src/bfstd.c
index c6c2e7f..5b64452 100644
--- a/src/bfstd.c
+++ b/src/bfstd.c
@@ -695,8 +695,12 @@ size_t xstrwidth(const char *str) {
if (wc == WEOF) {
// Assume a single-width '?'
++ret;
- } else {
- ret += xwcwidth(wc);
+ continue;
+ }
+
+ int width = xwcwidth(wc);
+ if (width > 0) {
+ ret += width;
}
}