diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-06 18:50:39 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-04-06 18:50:39 +0000 |
commit | 0f64621783b3f46a4851826b9f4284e3c9dbeb61 (patch) | |
tree | 352fcb09d9321309ec519dc3144147a24bd64bda /games/sail/dr_3.c | |
parent | 997f28507be542389b846c45806474af6bbfdedc (diff) |
2451 lines of strdup/sprintf/strcpy whacking. mostly ok'd by pjanzen
already, but he may have later changes to make still.
Diffstat (limited to 'games/sail/dr_3.c')
-rw-r--r-- | games/sail/dr_3.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/games/sail/dr_3.c b/games/sail/dr_3.c index f7e84d8f5fc..cadabd06722 100644 --- a/games/sail/dr_3.c +++ b/games/sail/dr_3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dr_3.c,v 1.2 1999/01/18 06:20:52 pjanzen Exp $ */ +/* $OpenBSD: dr_3.c,v 1.3 2003/04/06 18:50:38 deraadt Exp $ */ /* $NetBSD: dr_3.c,v 1.3 1995/04/22 10:36:49 cgd Exp $ */ /* @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)dr_3.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: dr_3.c,v 1.2 1999/01/18 06:20:52 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: dr_3.c,v 1.3 2003/04/06 18:50:38 deraadt Exp $"; #endif #endif /* not lint */ @@ -73,6 +73,7 @@ moveall() /* move all comp ships */ *sp->file->movebuf = '\0'; else closeon(sp, closest, sp->file->movebuf, + sizeof sp->file->movebuf, ta, ma, af); } else *sp->file->movebuf = '\0'; @@ -86,10 +87,12 @@ moveall() /* move all comp ships */ n = 0; foreachship(sp) { if (snagged(sp)) - (void) strcpy(sp->file->movebuf, "d"); + (void) strlcpy(sp->file->movebuf, "d", + sizeof sp->file->movebuf); else if (*sp->file->movebuf != 'd') - (void) strcat(sp->file->movebuf, "d"); + (void) strlcat(sp->file->movebuf, "d", + sizeof sp->file->movebuf); row[n] = sp->file->row; col[n] = sp->file->col; dir[n] = sp->file->dir; |