diff options
Diffstat (limited to 'bin/date/netdate.c')
-rw-r--r-- | bin/date/netdate.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/date/netdate.c b/bin/date/netdate.c index d240ef25daf..160afbbcf8c 100644 --- a/bin/date/netdate.c +++ b/bin/date/netdate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netdate.c,v 1.10 1997/09/01 18:29:22 deraadt Exp $ */ +/* $OpenBSD: netdate.c,v 1.11 2001/06/26 14:33:25 lebel Exp $ */ /* $NetBSD: netdate.c,v 1.10 1995/09/07 06:21:06 jtc Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)netdate.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: netdate.c,v 1.10 1997/09/01 18:29:22 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: netdate.c,v 1.11 2001/06/26 14:33:25 lebel Exp $"; #endif #endif /* not lint */ @@ -117,8 +117,7 @@ netsettime(tval) warn("gethostname"); goto bad; } - (void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name)-1); - msg.tsp_name[sizeof(msg.tsp_name)-1] = '\0'; + (void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name)); msg.tsp_seq = htons((u_short)0); msg.tsp_time.tv_sec = htonl((u_long)tval); msg.tsp_time.tv_usec = htonl((u_long)0); |