]> granicus.if.org Git - procps-ng/commitdiff
top: try to avoid premature truncation indicator ('+')
authorJim Warner <james.warner@comcast.net>
Sat, 27 Jan 2018 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Mon, 19 Feb 2018 09:37:24 +0000 (20:37 +1100)
Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 49a13caf294b1927ba1dad6509251a30ea0ae0cf..77781ba33253c1a2423c163255bfc66dc1852e0e 100644 (file)
--- 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;