summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido van Rooij <guido@FreeBSD.org>1997-03-10 19:52:12 +0000
committerGuido van Rooij <guido@FreeBSD.org>1997-03-10 19:52:12 +0000
commite298ae5d127385ea4ee185cef01bb7961e54ed9d (patch)
treeacb4ab155fdb9ba243cad4aa1ff77484b6fedd44
parent9408216e1778e36a1dc12a80600c7b01d0995bbe (diff)
Notes
-rw-r--r--bin/date/netdate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/date/netdate.c b/bin/date/netdate.c
index 88d914c3b03e..4ff5e2b20322 100644
--- a/bin/date/netdate.c
+++ b/bin/date/netdate.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: netdate.c,v 1.6 1997/02/22 14:02:35 peter Exp $
*/
#ifndef lint
@@ -116,7 +116,8 @@ netsettime(tval)
warn("gethostname");
goto bad;
}
- (void)strncpy(msg.tsp_name, hostname, sizeof(hostname));
+ (void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name));
+ msg.tsp_name[sizeof(msg.tsp_name) - 1] = '\0';
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);