version 1.9, 1998/01/09 17:17:39 |
version 1.10, 1998/07/10 15:45:19 |
|
|
#include <errno.h> |
#include <errno.h> |
#include <unistd.h> |
#include <unistd.h> |
#include <vis.h> |
#include <vis.h> |
|
#include <err.h> |
#include "finger.h" |
#include "finger.h" |
#include "extern.h" |
#include "extern.h" |
|
|
|
|
pn->mailrecv = -1; /* -1 == not_valid */ |
pn->mailrecv = -1; /* -1 == not_valid */ |
if (stat(tbuf, &sb) < 0) { |
if (stat(tbuf, &sb) < 0) { |
if (errno != ENOENT) { |
if (errno != ENOENT) { |
(void)fprintf(stderr, |
warn(tbuf); |
"finger: %s: %s\n", tbuf, strerror(errno)); |
|
return; |
return; |
} |
} |
} else if (sb.st_size != 0) { |
} else if (sb.st_size != 0) { |
|
|
{ |
{ |
PERSON *p; |
PERSON *p; |
|
|
if ((p = (PERSON *)malloc((u_int) sizeof(PERSON))) == NULL) { |
if ((p = (PERSON *)malloc((u_int) sizeof(PERSON))) == NULL) |
(void)fprintf(stderr, "finger: out of space.\n"); |
err(1, "malloc"); |
exit(1); |
|
} |
|
return(p); |
return(p); |
} |
} |
|
|
|
|
{ |
{ |
WHERE *w; |
WHERE *w; |
|
|
if ((w = (WHERE *)malloc((u_int) sizeof(WHERE))) == NULL) { |
if ((w = (WHERE *)malloc((u_int) sizeof(WHERE))) == NULL) |
(void)fprintf(stderr, "finger: out of space.\n"); |
err(1, "malloc"); |
exit(1); |
|
} |
|
if (pn->whead == NULL) |
if (pn->whead == NULL) |
pn->whead = pn->wtail = w; |
pn->whead = pn->wtail = w; |
else { |
else { |