From f164448775c6362174ad4512e2afa6f31506ac29 Mon Sep 17 00:00:00 2001 From: charnier Date: Fri, 31 Oct 1997 12:33:14 +0000 Subject: [PATCH] Make all strings representing hostnames to be NUL-terminated within MAXHOSTNAMELEN chars, like everywhere else in the system, so that strcpy()s and printf()s won't fail. --- usr.sbin/timed/timed/globals.h | 2 +- usr.sbin/timed/timed/slave.c | 4 ++-- usr.sbin/timed/timed/timed.c | 4 ++-- usr.sbin/timed/timedc/cmds.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/timed/timed/globals.h b/usr.sbin/timed/timed/globals.h index 9005a2a7a08b..852dd0cd71da 100644 --- a/usr.sbin/timed/timed/globals.h +++ b/usr.sbin/timed/timed/globals.h @@ -119,7 +119,7 @@ struct hosttbl { struct hosttbl *l_fwd; struct netinfo *ntp; struct sockaddr_in addr; - char name[MAXHOSTNAMELEN+1]; + char name[MAXHOSTNAMELEN]; u_char head; /* 1=head of hash chain */ u_char good; /* 0=trusted host, for averaging */ u_char noanswer; /* count of failures to answer */ diff --git a/usr.sbin/timed/timed/slave.c b/usr.sbin/timed/timed/slave.c index 24c71ab65471..bab9bcd22adb 100644 --- a/usr.sbin/timed/timed/slave.c +++ b/usr.sbin/timed/timed/slave.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)slave.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: slave.c,v 1.3 1997/10/22 06:19:48 charnier Exp $"; + "$Id: slave.c,v 1.4 1997/10/29 07:32:29 charnier Exp $"; #endif /* not lint */ #include "globals.h" @@ -49,7 +49,7 @@ extern int justquit; extern u_short sequence; -static char master_name[MAXHOSTNAMELEN+1]; +static char master_name[MAXHOSTNAMELEN]; static struct netinfo *old_slavenet; static int old_status; diff --git a/usr.sbin/timed/timed/timed.c b/usr.sbin/timed/timed/timed.c index a3c11e3efdc8..ec0ca63ad71b 100644 --- a/usr.sbin/timed/timed/timed.c +++ b/usr.sbin/timed/timed/timed.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "@(#)timed.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: timed.c,v 1.5 1997/10/22 06:19:49 charnier Exp $"; + "$Id: timed.c,v 1.6 1997/10/29 07:32:30 charnier Exp $"; #endif /* not lint */ #define TSPTYPES @@ -92,7 +92,7 @@ static struct nets { struct hosttbl hosttbl[NHOSTS+1]; /* known hosts */ static struct goodhost { /* hosts that we trust */ - char name[MAXHOSTNAMELEN+1]; + char name[MAXHOSTNAMELEN]; struct goodhost *next; char perm; } *goodhosts; diff --git a/usr.sbin/timed/timedc/cmds.c b/usr.sbin/timed/timedc/cmds.c index e52afa4e21e7..2c978082115b 100644 --- a/usr.sbin/timed/timedc/cmds.c +++ b/usr.sbin/timed/timedc/cmds.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)cmds.c 8.1 (Berkeley) 6/6/93"; #endif static const char rcsid[] = - "$Id: cmds.c,v 1.3 1997/10/22 06:20:04 charnier Exp $"; + "$Id: cmds.c,v 1.4 1997/10/29 07:35:27 charnier Exp $"; #endif /* not lint */ #include "timedc.h" @@ -68,7 +68,7 @@ static const char rcsid[] = int sock; int sock_raw; -char myname[MAXHOSTNAMELEN+1]; +char myname[MAXHOSTNAMELEN]; struct hostent *hp; struct sockaddr_in server; struct sockaddr_in dayaddr;