[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Coverity fix for games/monopoly



----------------------------8<----------------------------
Coverity CID 1005
Index: misc.c
===================================================================
RCS file: /cvs/src/games/monop/misc.c,v
retrieving revision 1.8
diff -u -r1.8 misc.c
--- misc.c	16 Dec 2003 19:26:44 -0000	1.8
+++ misc.c	22 Mar 2006 15:53:04 -0000
@@ -209,13 +209,17 @@
 				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
----------------------------8<----------------------------

Cheers,
Jasper

--
Humppa is a serious thing!

[demime 1.01d removed an attachment of type application/pgp-signature]



Visit your host, monkey.org