From 2ddf2e0d1f15e66a6b8e1121d76c62dfa68ef94f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 20 Jul 1998 06:57:23 +0000 Subject: 1998-07-20 Roland McGrath * ps.c (main): Fix return type to int, and use return. * ids.c (main): Likewise. * w.c (main): Likewise. * login.c (main): Likewise. * settrans.c (main): Likewise. * showtrans.c (main): Likewise. * fsysopts.c (main): Likewise. * storeinfo.c (main): Likewise. * w.c (main): Avoid warning from `while (a = b)'. --- utils/w.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'utils/w.c') diff --git a/utils/w.c b/utils/w.c index ce41de2d..1107bb05 100644 --- a/utils/w.c +++ b/utils/w.c @@ -1,6 +1,6 @@ /* Hurdish w - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. Written by Miles Bader @@ -344,7 +344,7 @@ uptime (struct proc_stat_list *procs) fmt_named_interval (&uptime, 0, uptime_rep, sizeof (uptime_rep)); } - strftime (tod_rep, sizeof (tod_rep), "%r", + strftime (tod_rep, sizeof (tod_rep), "%r", localtime ((time_t *)&now.tv_sec)); if (tod_rep[0] == '0') tod_rep[0] = ' '; /* Get rid of bletcherous leading 0. */ @@ -360,7 +360,7 @@ uptime (struct proc_stat_list *procs) (double)load->avenrun[2] / (double)LOAD_SCALE); } -void +int main(int argc, char *argv[]) { error_t err; @@ -446,7 +446,7 @@ main(int argc, char *argv[]) /* Read the utmp file. */ setutent (); - while (ut = getutent ()) + while ((ut = getutent ()) != NULL) add_utmp_procs (procs, ut); endutent (); @@ -464,5 +464,5 @@ main(int argc, char *argv[]) output_width, print_heading, squash_bogus_fields, squash_nominal_fields, 0); - exit(0); + return 0; } -- cgit v1.2.3