Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/w fixed user miscounting. reported by kim.



details:   https://anonhg.NetBSD.org/src/rev/41d8f22fb0b6
branches:  trunk
changeset: 535567:41d8f22fb0b6
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Aug 22 14:52:55 2002 +0000

description:
fixed user miscounting. reported by kim.

diffstat:

 usr.bin/w/w.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r d65ad456e240 -r 41d8f22fb0b6 usr.bin/w/w.c
--- a/usr.bin/w/w.c     Thu Aug 22 14:36:48 2002 +0000
+++ b/usr.bin/w/w.c     Thu Aug 22 14:52:55 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: w.c,v 1.49 2002/07/28 20:47:57 christos Exp $  */
+/*     $NetBSD: w.c,v 1.50 2002/08/22 14:52:55 christos Exp $  */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)w.c        8.6 (Berkeley) 6/30/94";
 #else
-__RCSID("$NetBSD: w.c,v 1.49 2002/07/28 20:47:57 christos Exp $");
+__RCSID("$NetBSD: w.c,v 1.50 2002/08/22 14:52:55 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -237,7 +237,6 @@
        while ((ut = getutent()) != NULL) {
                if (ut->ut_name[0] == '\0')
                        continue;
-               ++nusers;
                if (wcmd == 0 || (sel_user &&
                    strncmp(ut->ut_name, sel_user, sizeof(ut->ut_name) != 0)))
                        continue;
@@ -251,6 +250,7 @@
                if (ep != NULL)
                        continue;
 
+               ++nusers;
                if ((ep = calloc(1, sizeof(struct entry))) == NULL)
                        err(1, NULL);
                (void)memcpy(ep->name, ut->ut_name, sizeof(ut->ut_name));



Home | Main Index | Thread Index | Old Index