mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 17:32:43 +00:00
-Wall cleanup.
PR: 22187
This commit is contained in:
parent
04c94f3cfd
commit
1e832bf81d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=67467
@ -45,7 +45,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static const char copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
@ -174,8 +174,7 @@ lprint(pn)
|
||||
maxlen = len;
|
||||
/* find rest of entries for user */
|
||||
for (w = pn->whead; w != NULL; w = w->next) {
|
||||
switch (w->info) {
|
||||
case LOGGEDIN:
|
||||
if (w->info == LOGGEDIN) {
|
||||
tp = localtime(&w->loginat);
|
||||
strftime(t, sizeof(t), "%c", tp);
|
||||
tzn = tp->tm_zone;
|
||||
@ -204,12 +203,9 @@ lprint(pn)
|
||||
}
|
||||
if (!w->writable)
|
||||
cpr += printf(" (messages off)");
|
||||
break;
|
||||
case LASTLOG:
|
||||
if (w->loginat == 0) {
|
||||
(void)printf("Never logged in.");
|
||||
break;
|
||||
}
|
||||
} else if (w->loginat == 0) {
|
||||
cpr = printf("Never logged in.");
|
||||
} else {
|
||||
tp = localtime(&w->loginat);
|
||||
strftime(t, sizeof(t), "%c", tp);
|
||||
tzn = tp->tm_zone;
|
||||
@ -220,7 +216,6 @@ lprint(pn)
|
||||
else
|
||||
cpr = printf("Last login %.16s (%s) on %s",
|
||||
t, tzn, w->tty);
|
||||
break;
|
||||
}
|
||||
if (*w->host) {
|
||||
if (LINE_LEN < (cpr + 6 + strlen(w->host)))
|
||||
@ -298,6 +293,8 @@ show_text(directory, file_name, header)
|
||||
register char *p, lastc;
|
||||
int fd, nr;
|
||||
|
||||
lastc = '\0';
|
||||
|
||||
(void)snprintf(tbuf, sizeof(tbuf), "%s/%s", directory, file_name);
|
||||
if ((fd = open(tbuf, O_RDONLY)) < 0 || fstat(fd, &sb) ||
|
||||
sb.st_size == 0)
|
||||
@ -353,7 +350,7 @@ vputc(ch)
|
||||
meta = 1;
|
||||
} else
|
||||
meta = 0;
|
||||
if (isprint(ch) || !meta && (ch == ' ' || ch == '\t' || ch == '\n'))
|
||||
if (isprint(ch) || (!meta && (ch == ' ' || ch == '\t' || ch == '\n')))
|
||||
(void)putchar(ch);
|
||||
else {
|
||||
(void)putchar('^');
|
||||
|
@ -118,7 +118,7 @@ netfinger(name)
|
||||
static int
|
||||
do_protocol(const char *name, const struct addrinfo *ai)
|
||||
{
|
||||
int cnt, error, line_len, s;
|
||||
int cnt, line_len, s;
|
||||
register FILE *fp;
|
||||
register int c, lastc;
|
||||
struct iovec iov[3];
|
||||
@ -145,7 +145,7 @@ do_protocol(const char *name, const struct addrinfo *ai)
|
||||
iov[msg.msg_iovlen++].iov_len = 3;
|
||||
}
|
||||
/* send the name followed by <CR><LF> */
|
||||
iov[msg.msg_iovlen].iov_base = name;
|
||||
iov[msg.msg_iovlen].iov_base = (char *)name;
|
||||
iov[msg.msg_iovlen++].iov_len = strlen(name);
|
||||
iov[msg.msg_iovlen].iov_base = "\r\n";
|
||||
iov[msg.msg_iovlen++].iov_len = 2;
|
||||
|
Loading…
Reference in New Issue
Block a user