diff options
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; |