]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - monop/misc.c
Fix formatting bug apparently introduced when the page was mdoc'd. (Had
[bsdgames-darwin.git] / monop / misc.c
index f9a375573948616f2f4b8da279ef6d8ef48dda61..ec364c6504518c1039a02c11cc52f5cdc2ef4753 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $    */
+/*     $NetBSD: misc.c,v 1.15 2008/02/19 08:26:10 dholland Exp $       */
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)misc.c     8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: misc.c,v 1.12 2004/01/26 09:59:36 jsm Exp $");
+__RCSID("$NetBSD: misc.c,v 1.15 2008/02/19 08:26:10 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -109,9 +109,9 @@ inter:
                *sp = c;
                if (sp == buf)
                        continue;
-               for (sp = buf; isspace(*sp); sp++)
+               for (sp = buf; isspace((unsigned char)*sp); sp++)
                        continue;
-               for (; isdigit(*sp); sp++)
+               for (; isdigit((unsigned char)*sp); sp++)
                        num = num * 10 + *sp - '0';
                if (*sp == '\n')
                        return num;
@@ -130,7 +130,7 @@ set_ownlist(pl)
        int num;                /* general counter              */
        MON *orig;              /* remember starting monop ptr  */
        OWN *op;                /* current owned prop           */
-       OWN *orig_op;           /* origianl prop before loop    */
+       OWN *orig_op;           /* original prop before loop    */
 
        op = play[pl].own_list;
 #ifdef DEBUG
@@ -201,16 +201,21 @@ set_ownlist(pl)
                                printf("player # %d\n", pl+1);
                                printhold(pl);
                                printf("orig_op = %p\n", orig_op);
-                               printf("orig_op->sqr->type = %d (PRPTY)\n",
-                                   op->sqr->type);
-                               printf("orig_op->next = %p\n", op->next);
-                               printf("orig_op->sqr->desc = %p\n",
-                                   op->sqr->desc);
+                               if (orig_op) {
+                                       printf("orig_op->sqr->type = %d (PRPTY)\n",
+                                           orig_op->sqr->type);
+                                       printf("orig_op->next = %p\n", op->next);
+                                       printf("orig_op->sqr->desc = %p\n",
+                                           orig_op->sqr->desc);
+                               }
                                printf("op = %p\n", op);
-                               printf("op->sqr->type = %d (PRPTY)\n",
-                                   op->sqr->type);
-                               printf("op->next = %p\n", op->next);
-                               printf("op->sqr->desc = %p\n", op->sqr->desc);
+                               if (op) {
+                                       printf("op->sqr->type = %d (PRPTY)\n",
+                                           op->sqr->type);
+                                       printf("op->next = %p\n", op->next);
+                                       printf("op->sqr->desc = %p\n",
+                                           op->sqr->desc);
+                               }
                                printf("num = %d\n", num);
                        }
 #ifdef DEBUG