struct stat stb; /* stat of file for size */
long bl, delta; /* time difference */
int bytes, wfd;
struct stat stb; /* stat of file for size */
long bl, delta; /* time difference */
int bytes, wfd;
for (step = arglist; step; step = step->next)
switch(step->type) {
case HOST_TYPE:
if (!strncasecmp(step->name, bp->ut_host, UT_HOSTSIZE))
for (step = arglist; step; step = step->next)
switch(step->type) {
case HOST_TYPE:
if (!strncasecmp(step->name, bp->ut_host, UT_HOSTSIZE))
- if (!(cur = (ARG *)malloc((u_int)sizeof(ARG)))) {
- fputs("last: malloc failure.\n", stderr);
- exit(1);
- }
+ if (!(cur = (ARG *)malloc((u_int)sizeof(ARG))))
+ err(1, "malloc failure");
- if (!(cur = (TTY *)malloc((u_int)sizeof(TTY)))) {
- fputs("last: malloc failure.\n", stderr);
- exit(1);
- }
+ if (!(cur = (TTY *)malloc((u_int)sizeof(TTY))))
+ err(1, "malloc failure");
- bcopy(ttyname, cur->tty, UT_LINESIZE);
- return(ttylist = cur);
+ memmove(cur->tty, ttyname, UT_LINESIZE);
+ return (ttylist = cur);
- if (!(mval = malloc((u_int)8))) {
- fputs("last: malloc failure.\n", stderr);
- exit(1);
- }
+ if (!(mval = malloc((u_int)8)))
+ err(1, "malloc failure");
if (!strcmp(arg, "co"))
(void)strcpy(mval, "console");
else {
(void)strcpy(mval, "tty");
(void)strcpy(mval + 3, arg);
}
if (!strcmp(arg, "co"))
(void)strcpy(mval, "console");
else {
(void)strcpy(mval, "tty");
(void)strcpy(mval + 3, arg);
}