summaryrefslogtreecommitdiffstats
path: root/sail
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-03-09 04:38:39 +0000
committerdholland <dholland@NetBSD.org>2009-03-09 04:38:39 +0000
commitbce77562fb48b98e13e9d417788143bfb06ac739 (patch)
tree5c9b83883d1236b2d856bb206683cbcfc0370f1b /sail
parent5bcea6ec3e9494ee9a7dc1fe85e677de8e461387 (diff)
downloadbsdgames-darwin-bce77562fb48b98e13e9d417788143bfb06ac739.tar.gz
bsdgames-darwin-bce77562fb48b98e13e9d417788143bfb06ac739.tar.zst
bsdgames-darwin-bce77562fb48b98e13e9d417788143bfb06ac739.zip
sprintf -> snprintf
Diffstat (limited to 'sail')
-rw-r--r--sail/dr_1.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sail/dr_1.c b/sail/dr_1.c
index 63a5a81e..5cdaef5d 100644
--- a/sail/dr_1.c
+++ b/sail/dr_1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dr_1.c,v 1.23 2008/01/28 01:58:01 dholland Exp $ */
+/* $NetBSD: dr_1.c,v 1.24 2009/03/09 04:38:39 dholland 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.23 2008/01/28 01:58:01 dholland Exp $");
+__RCSID("$NetBSD: dr_1.c,v 1.24 2009/03/09 04:38:39 dholland Exp $");
#endif
#endif /* not lint */
@@ -190,7 +190,8 @@ fightitout(struct ship *from, struct ship *to, int key)
subtract(from, fromcap, totalfrom, crewfrom, pcfrom);
subtract(to, tocap, totalto, crewto, pcto);
makemsg(from, "boarders from %s repelled", to->shipname);
- sprintf(message, "killed in melee: %d. %s: %d",
+ snprintf(message, sizeof(message),
+ "killed in melee: %d. %s: %d",
totalto, from->shipname, totalfrom);
Writestr(W_SIGNAL, to, message);
if (key)
@@ -222,9 +223,11 @@ fightitout(struct ship *from, struct ship *to, int key)
subtract(to, tocap, mento, crewto, pcto);
subtract(from, to, - mento, crewfrom, 0);
}
- sprintf(message, "captured by the %s!", to->shipname);
+ snprintf(message, sizeof(message),
+ "captured by the %s!", to->shipname);
Writestr(W_SIGNAL, from, message);
- sprintf(message, "killed in melee: %d. %s: %d",
+ snprintf(message, sizeof(message),
+ "killed in melee: %d. %s: %d",
totalto, from->shipname, totalfrom);
Writestr(W_SIGNAL, to, message);
mento = 0;