From 2347521bb508b13587144059a0112a45e4ffd056 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 25 Feb 2012 23:54:51 +0100 Subject: [PATCH] w: fix compiler warnings w.c:409:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses] w.c:325:42: warning: unused variable 'args' [-Wunused-variable] Signed-off-by: Sami Kerola --- w.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/w.c b/w.c index f86f2df1..ccfa4b82 100644 --- a/w.c +++ b/w.c @@ -325,7 +325,7 @@ int main(int argc, char **argv) char *user = NULL, *p; utmp_t *u; struct winsize win; - int header = 1, longform = 1, from = 1, args, maxcmd = 80, ch; + int header = 1, longform = 1, from = 1, maxcmd = 80, ch; int userlen = 8; int fromlen = 16; char *env_var; @@ -409,7 +409,7 @@ int main(int argc, char **argv) } if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) != -1 && win.ws_col > 0) maxcmd = win.ws_col; - else if (p = getenv("COLUMNS")) + else if ((p = getenv("COLUMNS"))) maxcmd = atoi(p); else maxcmd = 80; -- 2.40.0