From a3e56e863557a9de54251c4a77c56bfb88a4b12d Mon Sep 17 00:00:00 2001 From: antoine Date: Mon, 17 Mar 2008 18:31:43 +0000 Subject: Initialize variable "now" before using it (it is used by the LEFTEARTH macro) PR: 121418 Submitted by: Atsuo Ohki Approved by: rwatson (mentor) MFC after: 1 month --- usr.bin/ruptime/ruptime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c index f0778ea..1e3356f 100644 --- a/usr.bin/ruptime/ruptime.c +++ b/usr.bin/ruptime/ruptime.c @@ -191,6 +191,7 @@ ruptime(const char *host, int aflg, int (*cmp)(const void *, const void *)) rewinddir(dirp); hsp = NULL; maxloadav = -1; + (void)time(&now); for (nhosts = hspace = 0; (dp = readdir(dirp)) != NULL;) { if (dp->d_ino == 0 || strncmp(dp->d_name, "whod.", 5) != 0) continue; @@ -239,7 +240,6 @@ ruptime(const char *host, int aflg, int (*cmp)(const void *, const void *)) warnx("host %s not in %s", host, _PATH_RWHODIR); } - (void)time(&now); qsort(hs, nhosts, sizeof(hs[0]), cmp); for (i = 0; i < (int)nhosts; i++) { hsp = &hs[i]; -- cgit v1.1