From de2ea2d1786628172b4c5a19ee7c57246c95be3a Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 26 Jun 2009 15:34:12 +0000 Subject: 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. --- screen-write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'screen-write.c') diff --git a/screen-write.c b/screen-write.c index 2bbfb296..73e3fb2d 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++; -- cgit