From 9af478c13d2e15d07a35baf79d145bcc0f311367 Mon Sep 17 00:00:00 2001 From: Craig Small Date: Wed, 25 Apr 2012 10:21:07 +1000 Subject: [PATCH] Remove trailing - from w from column Jaromir Capik discovered that the from column for w would print a trailing - for some types of hosts. --- w.c | 1 + 1 file changed, 1 insertion(+) 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;