diff options
author | jrf <jrf@NetBSD.org> | 2004-09-07 13:20:39 +0000 |
---|---|---|
committer | jrf <jrf@NetBSD.org> | 2004-09-07 13:20:39 +0000 |
commit | 2aa9d1c9dd8fe6a21ef55ac92c224c9b3d9701ad (patch) | |
tree | cbb709392f5d6086ee3ace79049f80e1cf907d55 /sail/sync.c | |
parent | de4d1a52a2092219d32f0f0b88b2f3efa7cee540 (diff) | |
download | bsdgames-darwin-2aa9d1c9dd8fe6a21ef55ac92c224c9b3d9701ad.tar.gz bsdgames-darwin-2aa9d1c9dd8fe6a21ef55ac92c224c9b3d9701ad.tar.zst bsdgames-darwin-2aa9d1c9dd8fe6a21ef55ac92c224c9b3d9701ad.zip |
Replaced strncpy with strlcpy. Thanks to Peter Postma who
pointed them our in PR #25762. Approved by christos@NetBSD.org.
Diffstat (limited to 'sail/sync.c')
-rw-r--r-- | sail/sync.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/sail/sync.c b/sail/sync.c index d9532ebb..7fe76604 100644 --- a/sail/sync.c +++ b/sail/sync.c @@ -1,4 +1,4 @@ -/* $NetBSD: sync.c,v 1.22 2004/01/27 20:27:59 jsm Exp $ */ +/* $NetBSD: sync.c,v 1.23 2004/09/07 13:20:39 jrf Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)sync.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: sync.c,v 1.22 2004/01/27 20:27:59 jsm Exp $"); +__RCSID("$NetBSD: sync.c,v 1.23 2004/09/07 13:20:39 jrf Exp $"); #endif #endif /* not lint */ @@ -379,9 +379,8 @@ sync_update(int type, struct ship *ship, const char *astr, long a, long b, long break; } case W_CAPTAIN: - strncpy(ship->file->captain, astr, - sizeof ship->file->captain - 1); - ship->file->captain[sizeof ship->file->captain - 1] = 0; + strlcpy(ship->file->captain, astr, + sizeof ship->file->captain); break; case W_CAPTURED: if (a < 0) @@ -418,9 +417,8 @@ sync_update(int type, struct ship *ship, const char *astr, long a, long b, long ship->specs->hull = a; break; case W_MOVE: - strncpy(ship->file->movebuf, astr, - sizeof ship->file->movebuf - 1); - ship->file->movebuf[sizeof ship->file->movebuf - 1] = 0; + strlcpy(ship->file->movebuf, astr, + sizeof ship->file->movebuf); break; case W_PCREW: ship->file->pcrew = a; |