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 <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-02-25 23:54:51 +01:00 committed by Craig Small
parent 909285ce44
commit 2347521bb5

4
w.c
View File

@ -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;