From 2aa9d1c9dd8fe6a21ef55ac92c224c9b3d9701ad Mon Sep 17 00:00:00 2001 From: jrf Date: Tue, 7 Sep 2004 13:20:39 +0000 Subject: Replaced strncpy with strlcpy. Thanks to Peter Postma who pointed them our in PR #25762. Approved by christos@NetBSD.org. --- sail/dr_1.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'sail/dr_1.c') diff --git a/sail/dr_1.c b/sail/dr_1.c index 6610af4b..1d8b5444 100644 --- a/sail/dr_1.c +++ b/sail/dr_1.c @@ -1,4 +1,4 @@ -/* $NetBSD: dr_1.c,v 1.19 2003/08/07 09:37:41 agc Exp $ */ +/* $NetBSD: dr_1.c,v 1.20 2004/09/07 13:20:39 jrf Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)dr_1.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: dr_1.c,v 1.19 2003/08/07 09:37:41 agc Exp $"); +__RCSID("$NetBSD: dr_1.c,v 1.20 2004/09/07 13:20:39 jrf Exp $"); #endif #endif /* not lint */ @@ -429,10 +429,8 @@ next(void) *tp = toupper(*tp); p = tp; } - strncpy(bestship->file->captain, p, + strlcpy(bestship->file->captain, p, sizeof bestship->file->captain); - bestship->file->captain - [sizeof bestship->file->captain - 1] = 0; logger(bestship); } return -1; -- cgit v1.2.3