summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger/finger.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-09-12 21:58:31 +0000
committerbrian <brian@FreeBSD.org>2000-09-12 21:58:31 +0000
commit573a7b70f398a53f5789f80ae7d6bd8a64d6f949 (patch)
treef1cd2a5e78dbae747839fe6da772e0d053a3c6dc /usr.bin/finger/finger.c
parent5288925756234ff8676e6bc4f0381984cc0223de (diff)
downloadFreeBSD-src-573a7b70f398a53f5789f80ae7d6bd8a64d6f949.zip
FreeBSD-src-573a7b70f398a53f5789f80ae7d6bd8a64d6f949.tar.gz
Don't drop out when we've processed argc - 1 names.... arguments
may expand to more than one user. PR: 21228
Diffstat (limited to 'usr.bin/finger/finger.c')
-rw-r--r--usr.bin/finger/finger.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c
index 18ca287..006c67d 100644
--- a/usr.bin/finger/finger.c
+++ b/usr.bin/finger/finger.c
@@ -274,7 +274,6 @@ userlist(argc, argv)
char conf_alias[LINE_MAX];
char *conf_realname;
int conf_length;
- int nip;
if ((nargv = malloc((argc+1) * sizeof(char *))) == NULL ||
(used = calloc(argc, sizeof(int))) == NULL)
@@ -333,17 +332,14 @@ userlist(argc, argv)
}
}
else {
- nip = 0;
- while (nip < argc && (pw = getpwent()) != NULL) {
+ while ((pw = getpwent()) != NULL) {
for (p = argv, ip = used; *p; ++p, ++ip)
if (**p == '/' && *ip != 1
- && show_text("", *p, "")) {
+ && show_text("", *p, ""))
*ip = 1;
- nip++;
- } else if (match(pw, *p) && !hide(pw)) {
+ else if (match(pw, *p) && !hide(pw)) {
enter_person(pw);
*ip = 1;
- nip++;
}
}
for (p = argv, ip = used; *p; ++p, ++ip)
OpenPOWER on IntegriCloud