From: Craig Small Date: Wed, 25 Apr 2012 00:21:07 +0000 (+1000) Subject: Remove trailing - from w from column X-Git-Tag: v3.3.3~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9af478c13d2e15d07a35baf79d145bcc0f311367;p=procps-ng Remove trailing - from w from column Jaromir Capik discovered that the from column for w would print a trailing - for some types of hosts. --- diff --git a/w.c b/w.c index 03cf983f..4ca84deb 100644 --- a/w.c +++ b/w.c @@ -82,6 +82,7 @@ static void print_host(const char *restrict host, int len, const int fromlen) len = fromlen; last = host + len; for (; host < last; host++) { + if (*host == '\0') break; if (isprint(*host) && *host != ' ') { fputc(*host, stdout); ++width;