summaryrefslogtreecommitdiffstats
path: root/screen-write.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-06-26 15:13:39 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-06-26 15:13:39 +0000
commit1ec736a3dc43755a283c22c090f8d3183623cce6 (patch)
tree1ed5548fe2a24f208d2789ff8531b42bf8c6c8de /screen-write.c
parentc506e7f71194b25c4ba2bf0087c7ebc3fff34b05 (diff)
Status line fixes: don't truncate status-right now the length calculation is
done for UTF-8, limit to the maximum length correctly when printing, and always print a space even if the left string is longer than the width available.
Diffstat (limited to 'screen-write.c')
-rw-r--r--screen-write.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/screen-write.c b/screen-write.c
index f0cdec30..e3a215ac 100644
--- a/screen-write.c
+++ b/screen-write.c
@@ -164,7 +164,7 @@ screen_write_vnputs(struct screen_write_ctx *ctx, ssize_t maxlen,
gc->flags &= ~GRID_FLAG_UTF8;
} else {
- if (maxlen > 0 && size > (size_t) maxlen)
+ if (maxlen > 0 && size + 1 > (size_t) maxlen)
break;
size++;