summaryrefslogtreecommitdiffstats
path: root/games/monop/misc.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2006-03-27 00:10:14 +0000
committertedu <tedu@openbsd.org>2006-03-27 00:10:14 +0000
commit34944f9006c6cbce1c4895512e480cf74b725035 (patch)
tree4b3aa6669418869ecc10609ce99d8396ef6a63b6 /games/monop/misc.c
parentRemove an extraneous prototype (diff)
downloadwireguard-openbsd-34944f9006c6cbce1c4895512e480cf74b725035.tar.xz
wireguard-openbsd-34944f9006c6cbce1c4895512e480cf74b725035.zip
assorted fixes mostly from coverity via netbsd via jasper adriaanse via tech
Diffstat (limited to 'games/monop/misc.c')
-rw-r--r--games/monop/misc.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/games/monop/misc.c b/games/monop/misc.c
index 22b71e7f014..112001987a1 100644
--- a/games/monop/misc.c
+++ b/games/monop/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.8 2003/12/16 19:26:44 deraadt Exp $ */
+/* $OpenBSD: misc.c,v 1.9 2006/03/27 00:10:15 tedu Exp $ */
/* $NetBSD: misc.c,v 1.4 1995/03/23 08:34:47 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: misc.c,v 1.8 2003/12/16 19:26:44 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: misc.c,v 1.9 2006/03/27 00:10:15 tedu Exp $";
#endif
#endif /* not lint */
@@ -204,19 +204,29 @@ set_ownlist(pl)
#ifdef DEBUG
printf("num = %d\n", num);
#endif
- if (orig == 0) {
+ if (orig == NULL) {
printf("panic: bad monopoly descriptor: orig = %p\n", orig);
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",
+ orig_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);
+ exit(1);
}
#ifdef DEBUG
printf("orig->num_in = %d\n", orig->num_in);