SCCS-vsn: usr.bin/finger/finger.c 5.22
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)finger.c 5.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)finger.c 5.22 (Berkeley) %G%";
{
register i;
register PERSON *pn;
{
register i;
register PERSON *pn;
+ PERSON *nethead, **nettail;
struct utmp user;
struct passwd *pw;
int dolocal, *used;
struct utmp user;
struct passwd *pw;
int dolocal, *used;
}
/* pull out all network requests */
}
/* pull out all network requests */
- for (i = 0, dolocal = 0, nethead = NULL; i < argc; i++) {
+ for (i = 0, dolocal = 0, nettail = &nethead; i < argc; i++) {
if (!index(argv[i], '@')) {
dolocal = 1;
continue;
}
pn = palloc();
if (!index(argv[i], '@')) {
dolocal = 1;
continue;
}
pn = palloc();
- pn->next = nethead;
- nethead = pn;
+ *nettail = pn;
+ nettail = &pn->next;
pn->name = argv[i];
used[i] = -1;
}
pn->name = argv[i];
used[i] = -1;
}