From: Jim Warner Date: Sat, 27 Jan 2018 06:00:00 +0000 (-0600) Subject: top: try to avoid premature truncation indicator ('+') X-Git-Tag: v3.3.13rc1~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dddb8e1751d1802a13dae3d611f2c3956699e3ac;p=procps-ng top: try to avoid premature truncation indicator ('+') Signed-off-by: Jim Warner --- diff --git a/top/top.c b/top/top.c index 49a13caf..77781ba3 100644 --- a/top/top.c +++ b/top/top.c @@ -1674,7 +1674,7 @@ static inline const char *make_str_utf8 (const char *str, int width, int justr, static char buf[SCREENMAX]; int delta = utf8_delta(str); - if (width + delta <= snprintf(buf, sizeof(buf), "%s", str)) { + if (width + delta < snprintf(buf, sizeof(buf), "%s", str)) { snprintf(buf, sizeof(buf), "%.*s", utf8_embody(str, width - 1), str); delta = utf8_delta(buf); buf[width + delta - 1] = COLPLUSCH;