diff options
author | dholland <dholland@NetBSD.org> | 2008-02-19 09:32:34 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2008-02-19 09:32:34 +0000 |
commit | 83ccf38996c164203905a620ecf3c8e14ecb1768 (patch) | |
tree | 18bc034193de0cb15ca9b5ffc707f6961cdb54e7 /monop | |
parent | 7b6be30c35ffc31d7abab3b759819288cda3cf45 (diff) | |
download | bsdgames-darwin-83ccf38996c164203905a620ecf3c8e14ecb1768.tar.gz bsdgames-darwin-83ccf38996c164203905a620ecf3c8e14ecb1768.tar.zst bsdgames-darwin-83ccf38996c164203905a620ecf3c8e14ecb1768.zip |
Don't use sprintf; use snprintf.
Diffstat (limited to 'monop')
-rw-r--r-- | monop/houses.c | 11 | ||||
-rw-r--r-- | monop/prop.c | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/monop/houses.c b/monop/houses.c index 403d0887..631c1034 100644 --- a/monop/houses.c +++ b/monop/houses.c @@ -1,4 +1,4 @@ -/* $NetBSD: houses.c,v 1.9 2006/03/19 00:19:31 christos Exp $ */ +/* $NetBSD: houses.c,v 1.10 2008/02/19 09:32:34 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)houses.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: houses.c,v 1.9 2006/03/19 00:19:31 christos Exp $"); +__RCSID("$NetBSD: houses.c,v 1.10 2008/02/19 09:32:34 dholland Exp $"); #endif #endif /* not lint */ @@ -133,7 +133,7 @@ over: temp[i] = 5; continue; } - (void)sprintf(cur_prop, "%s (%d): ", + (void)snprintf(cur_prop, sizeof(cur_prop), "%s (%d): ", mp->sq[i]->name, pp->houses); input[i] = get_int(cur_prop); temp[i] = input[i] + pp->houses; @@ -237,10 +237,11 @@ over: continue; } if (pp->houses < 5) - (void)sprintf(cur_prop,"%s (%d): ", + (void)snprintf(cur_prop, sizeof(cur_prop), "%s (%d): ", mp->sq[i]->name,pp->houses); else - (void)sprintf(cur_prop,"%s (H): ",mp->sq[i]->name); + (void)snprintf(cur_prop, sizeof(cur_prop), "%s (H): ", + mp->sq[i]->name); input[i] = get_int(cur_prop); temp[i] = pp->houses - input[i]; if (temp[i] < 0) { diff --git a/monop/prop.c b/monop/prop.c index f5784b6e..916129ad 100644 --- a/monop/prop.c +++ b/monop/prop.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop.c,v 1.12 2008/01/28 06:16:13 dholland Exp $ */ +/* $NetBSD: prop.c,v 1.13 2008/02/19 09:32:34 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)prop.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: prop.c,v 1.12 2008/01/28 06:16:13 dholland Exp $"); +__RCSID("$NetBSD: prop.c,v 1.13 2008/02/19 09:32:34 dholland Exp $"); #endif #endif /* not lint */ @@ -180,7 +180,8 @@ bid() i = (i + 1) % num_play; if (in[i]) { do { - (void)sprintf(buf, "%s: ", name_list[i]); + (void)snprintf(buf, sizeof(buf), "%s: ", + name_list[i]); cur_bid = get_int(buf); if (cur_bid == 0) { in[i] = FALSE; |