From 1ddc2a9f456fd76be3119dbaf2c5afccc9781cfc Mon Sep 17 00:00:00 2001 From: dholland Date: Sat, 23 Feb 2008 22:17:02 +0000 Subject: Bug fixes from OpenBSD: - don't truncate unreasonably long player names when bidding; - don't allow players to bid more cash than they have. --- monop/prop.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'monop') diff --git a/monop/prop.c b/monop/prop.c index 0dfc11b8..f85c87f9 100644 --- a/monop/prop.c +++ b/monop/prop.c @@ -1,4 +1,4 @@ -/* $NetBSD: prop.c,v 1.15 2008/02/20 05:08:46 dholland Exp $ */ +/* $NetBSD: prop.c,v 1.16 2008/02/23 22:17:02 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.15 2008/02/20 05:08:46 dholland Exp $"); +__RCSID("$NetBSD: prop.c,v 1.16 2008/02/23 22:17:02 dholland Exp $"); #endif #endif /* not lint */ @@ -166,7 +166,7 @@ bid() { static bool in[MAX_PL]; int i, num_in, cur_max; - char buf[80]; + char buf[257]; int cur_bid; printf("\nSo it goes up for auction. Type your bid after your name\n"); @@ -190,6 +190,10 @@ bid() printf("You must bid higher than %d " "to stay in\n", cur_max); printf("(bid of 0 drops you out)\n"); + } else if (cur_bid > play[i].money) { + printf("You can't bid more than your cash ($%d)\n", + play[i].money); + cur_bid = -1; } } while (cur_bid != 0 && cur_bid <= cur_max); cur_max = (cur_bid ? cur_bid : cur_max); -- cgit v1.2.3-56-ge451