summaryrefslogtreecommitdiff
path: root/bin/date
diff options
context:
space:
mode:
authoritojun <itojun@NetBSD.org>2003-07-12 13:23:55 +0000
committeritojun <itojun@NetBSD.org>2003-07-12 13:23:55 +0000
commit032ed69f9a47a49c09dd24ffb4e5dfa09cd030b8 (patch)
tree7a1ccda107e800453dafc3f5041e5ada3118f8af /bin/date
parenta7f5ddbf6454871154c3109480b03fd50760ff2d (diff)
strlcpy
Diffstat (limited to 'bin/date')
-rw-r--r--bin/date/netdate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/date/netdate.c b/bin/date/netdate.c
index c3f8ca74d82..b07f01f6b8f 100644
--- a/bin/date/netdate.c
+++ b/bin/date/netdate.c
@@ -1,4 +1,4 @@
-/* $NetBSD: netdate.c,v 1.22 2002/09/21 18:15:57 mycroft Exp $ */
+/* $NetBSD: netdate.c,v 1.23 2003/07/12 13:23:55 itojun Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)netdate.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: netdate.c,v 1.22 2002/09/21 18:15:57 mycroft Exp $");
+__RCSID("$NetBSD: netdate.c,v 1.23 2003/07/12 13:23:55 itojun Exp $");
#endif
#endif /* not lint */
@@ -131,7 +131,7 @@ netsettime(time_t tval)
goto bad;
}
hostname[sizeof(hostname) - 1] = '\0';
- (void)strncpy(msg.tsp_name, hostname, sizeof(hostname));
+ (void)strlcpy(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);