summaryrefslogtreecommitdiff
path: root/games/hack
diff options
context:
space:
mode:
authorjnemeth <jnemeth@NetBSD.org>2006-03-30 01:25:52 +0000
committerjnemeth <jnemeth@NetBSD.org>2006-03-30 01:25:52 +0000
commitf413c2ba58c829d64c4d8b82d522b41a0066ddeb (patch)
tree9b251397e8a08e753fa4caf52c5ab4e43ed48f7e /games/hack
parent8d5214b18a2521f899bee290fed521ffed496ed9 (diff)
Coverity CID 1326: check for error return
Diffstat (limited to 'games/hack')
-rw-r--r--games/hack/hack.dog.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/games/hack/hack.dog.c b/games/hack/hack.dog.c
index 00dc575e9fc..1e839c977c0 100644
--- a/games/hack/hack.dog.c
+++ b/games/hack/hack.dog.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.dog.c,v 1.6 2003/04/02 18:36:36 jsm Exp $ */
+/* $NetBSD: hack.dog.c,v 1.7 2006/03/30 01:25:52 jnemeth Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.dog.c,v 1.6 2003/04/02 18:36:36 jsm Exp $");
+__RCSID("$NetBSD: hack.dog.c,v 1.7 2006/03/30 01:25:52 jnemeth Exp $");
#endif /* not lint */
#include "hack.h"
@@ -366,6 +366,8 @@ dog_move(struct monst *mtmp, int after)
ny = poss[i].y;
if (info[i] & ALLOW_M) {
mtmp2 = m_at(nx, ny);
+ if (mtmp2 = NULL)
+ panic("error in dog_move");
if (mtmp2->data->mlevel >= mdat->mlevel + 2 ||
mtmp2->data->mlet == 'c')
continue;