]> git.cameronkatri.com Git - bsdgames-darwin.git/commitdiff
Bug fixes from OpenBSD:
authordholland <dholland@NetBSD.org>
Sat, 23 Feb 2008 22:17:02 +0000 (22:17 +0000)
committerdholland <dholland@NetBSD.org>
Sat, 23 Feb 2008 22:17:02 +0000 (22:17 +0000)
   - don't truncate unreasonably long player names when bidding;
   - don't allow players to bid more cash than they have.

monop/prop.c

index 0dfc11b83160c4ef5f27e30a9fad5a8144342ac7..f85c87f979db5cfdf02835d120ba00050ce289ab 100644 (file)
@@ -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
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)prop.c     8.1 (Berkeley) 5/31/93";
 #else
 #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 */
 
 #endif
 #endif /* not lint */
 
@@ -166,7 +166,7 @@ bid()
 {
        static bool in[MAX_PL];
        int i, num_in, cur_max;
 {
        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");
        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");
                                        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);
                                }
                        } while (cur_bid != 0 && cur_bid <= cur_max);
                        cur_max = (cur_bid ? cur_bid : cur_max);