Fixed a bug that made lastlogin ignore the first user argument

This commit is contained in:
wulf 2003-12-16 15:40:29 +00:00
parent a8250ce937
commit 4a58b169c3

View File

@ -1,4 +1,4 @@
/* $NetBSD: lastlogin.c,v 1.7 2003/08/28 15:54:41 elric Exp $ */ /* $NetBSD: lastlogin.c,v 1.8 2003/12/16 15:40:29 wulf Exp $ */
/* /*
* Copyright (c) 1996 John M. Vinopal * Copyright (c) 1996 John M. Vinopal
* All rights reserved. * All rights reserved.
@ -33,7 +33,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#ifndef lint #ifndef lint
__RCSID("$NetBSD: lastlogin.c,v 1.7 2003/08/28 15:54:41 elric Exp $"); __RCSID("$NetBSD: lastlogin.c,v 1.8 2003/12/16 15:40:29 wulf Exp $");
#endif #endif
#include <sys/types.h> #include <sys/types.h>
@ -104,9 +104,9 @@ main(argc, argv)
setpassent(1); /* Keep passwd file pointers open */ setpassent(1); /* Keep passwd file pointers open */
/* Process usernames given on the command line. */ /* Process usernames given on the command line. */
if (argc > 1) { if (argc > 0) {
long offset; long offset;
for (i = 1; i < argc; ++i) { for (i = 0; i < argc; i++) {
if ((passwd = getpwnam(argv[i])) == NULL) { if ((passwd = getpwnam(argv[i])) == NULL) {
warnx("user '%s' not found", argv[i]); warnx("user '%s' not found", argv[i]);
continue; continue;