summaryrefslogtreecommitdiff
path: root/usr.sbin/timed/timedc
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-04-02 09:13:49 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-04-02 09:13:49 +0000
commitd1fa381e4173c374c2e34c6cd2b62605c7d0c709 (patch)
tree517678bc29b33155ba6934a62e62ae0ebbc86b80 /usr.sbin/timed/timedc
parent63a05e086a56ff9371430a3db2fe2ced8874460a (diff)
Use strlcpy where possible.
Diffstat (limited to 'usr.sbin/timed/timedc')
-rw-r--r--usr.sbin/timed/timedc/cmds.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/timed/timedc/cmds.c b/usr.sbin/timed/timedc/cmds.c
index 2410da4c986..b45e9bb6462 100644
--- a/usr.sbin/timed/timedc/cmds.c
+++ b/usr.sbin/timed/timedc/cmds.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)cmds.c 5.1 (Berkeley) 5/11/93";
#endif /* not lint */
#ifdef sgi
-#ident "$Revision: 1.5 $"
+#ident "$Revision: 1.6 $"
#endif
#include "timedc.h"
@@ -306,8 +306,7 @@ msite(int argc, char *argv[])
}
bcopy(hp->h_addr, &dest.sin_addr.s_addr, hp->h_length);
- (void)strncpy(msg.tsp_name, myname, sizeof msg.tsp_name-1);
- msg.tsp_name[sizeof msg.tsp_name-1] = '\0';
+ (void)strlcpy(msg.tsp_name, myname, sizeof msg.tsp_name);
msg.tsp_type = TSP_MSITE;
msg.tsp_vers = TSPVERSION;
bytenetorder(&msg);
@@ -454,8 +453,7 @@ tracing(int argc, char *argv[])
onflag = OFF;
}
- (void)strncpy(msg.tsp_name, myname, sizeof msg.tsp_name-1);
- msg.tsp_name[sizeof msg.tsp_name-1] = '\0';
+ (void)strlcpy(msg.tsp_name, myname, sizeof msg.tsp_name);
msg.tsp_vers = TSPVERSION;
bytenetorder(&msg);
if (sendto(sock, &msg, sizeof(struct tsp), 0,