diff options
author | brian <brian@FreeBSD.org> | 2001-03-09 21:24:13 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-03-09 21:24:13 +0000 |
commit | b80431a1059c41b4237b8514ed47e5f29f5d33ab (patch) | |
tree | d603fbc231dabc0878f6344430aa9b27978ecedc /usr.sbin/syslogd/syslogd.c | |
parent | 7197fe7761223aece74c895dbaebb5fb0acc56cf (diff) | |
download | FreeBSD-src-b80431a1059c41b4237b8514ed47e5f29f5d33ab.zip FreeBSD-src-b80431a1059c41b4237b8514ed47e5f29f5d33ab.tar.gz |
MAXHOSTNAMELEN includes the NUL
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r-- | usr.sbin/syslogd/syslogd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index dc017ac..ba71c95 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -162,7 +162,7 @@ struct filed { union { char f_uname[MAXUNAMES][UT_NAMESIZE+1]; struct { - char f_hname[MAXHOSTNAMELEN+1]; + char f_hname[MAXHOSTNAMELEN]; struct addrinfo *f_addr; } f_forw; /* forwarding address */ @@ -174,7 +174,7 @@ struct filed { } f_un; char f_prevline[MAXSVLINE]; /* last message logged */ char f_lasttime[16]; /* time of last occurrence */ - char f_prevhost[MAXHOSTNAMELEN+1]; /* host from which recd. */ + char f_prevhost[MAXHOSTNAMELEN]; /* host from which recd. */ int f_prevpri; /* pri of f_prevline */ int f_prevlen; /* length of f_prevline */ int f_prevcount; /* repetition cnt of prevline */ @@ -257,7 +257,7 @@ struct filed consfile; int Debug; /* debug flag */ int resolve = 1; /* resolve hostname */ -char LocalHostName[MAXHOSTNAMELEN+1]; /* our hostname */ +char LocalHostName[MAXHOSTNAMELEN]; /* our hostname */ char *LocalDomain; /* our local domain name */ int *finet = NULL; /* Internet datagram socket */ int fklog = -1; /* /dev/klog */ @@ -1339,7 +1339,7 @@ init(signo) char *p; char cline[LINE_MAX]; char prog[NAME_MAX+1]; - char host[MAXHOSTNAMELEN+1]; + char host[MAXHOSTNAMELEN]; dprintf("init\n"); @@ -1416,7 +1416,7 @@ init(signo) } if (*p == '@') p = LocalHostName; - for (i = 1; i < MAXHOSTNAMELEN; i++) { + for (i = 1; i < MAXHOSTNAMELEN - 1; i++) { if (!isalnum(*p) && *p != '.' && *p != '-') break; host[i] = *p++; |