]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - monop/morg.c
Sanity fixes for input buffer handling. From OpenBSD
[bsdgames-darwin.git] / monop / morg.c
index 4b8e69f6744a2ff5f8855bed346b77687f0a45ad..faf720961fcdd0db56f7e9a4195aedcc3251e88e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: morg.c,v 1.10 2004/01/27 20:30:30 jsm Exp $    */
+/*     $NetBSD: morg.c,v 1.14 2008/02/20 05:08:46 dholland Exp $       */
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)morg.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: morg.c,v 1.10 2004/01/27 20:30:30 jsm Exp $");
+__RCSID("$NetBSD: morg.c,v 1.14 2008/02/20 05:08:46 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -66,7 +66,7 @@ static const char     *names[MAX_PRP+2],
 
 static short   square[MAX_PRP+2];
 
-static int     num_good,got_houses;
+static int     num_good, got_houses;
 
 
 static int set_mlist(void);
@@ -83,7 +83,7 @@ static void fix_ex(int);
 void
 mortgage()
 {
-       int prop;
+       int propnum;
 
        for (;;) {
                if (set_mlist() == 0) {
@@ -102,10 +102,11 @@ mortgage()
                                m(square[0]);
                        return;
                }
-               prop = getinp("Which property do you want to mortgage? ",names);
-               if (prop == num_good)
+               propnum = getinp("Which property do you want to mortgage? ",
+                               names);
+               if (propnum == num_good)
                        return;
-               m(square[prop]);
+               m(square[propnum]);
                notify();
        }
 }
@@ -137,13 +138,13 @@ set_mlist()
  *     This routine actually mortgages the property.
  */
 static void
-m(prop)
-       int prop;
+m(propnum)
+       int propnum;
 {
        int price;
 
-       price = board[prop].cost/2;
-       board[prop].desc->morg = TRUE;
+       price = board[propnum].cost/2;
+       board[propnum].desc->morg = TRUE;
        printf("That got you $%d\n",price);
        cur_p->money += price;
 }
@@ -154,9 +155,9 @@ m(prop)
  * to be unmortgaged.
  */
 void
-unmortgage() 
+unmortgage()
 {
-       int prop;
+       int propnum;
 
        for (;;) {
                if (set_umlist() == 0) {
@@ -169,11 +170,11 @@ unmortgage()
                                unm(square[0]);
                        return;
                }
-               prop = getinp("Which property do you want to unmortgage? ",
+               propnum = getinp("Which property do you want to unmortgage? ",
                    names);
-               if (prop == num_good)
+               if (propnum == num_good)
                        return;
-               unm(square[prop]);
+               unm(square[propnum]);
        }
 }
 
@@ -200,13 +201,13 @@ set_umlist()
  *     This routine actually unmortgages the property
  */
 static void
-unm(prop)
-       int prop
+unm(propnum)
+       int propnum;
 {
        int price;
 
-       price = board[prop].cost/2;
-       board[prop].desc->morg = FALSE;
+       price = board[propnum].cost/2;
+       board[propnum].desc->morg = FALSE;
        price += price/10;
        printf("That cost you $%d\n",price);
        cur_p->money -= price;