From: Pasi Kallinen Date: Wed, 2 Aug 2017 16:48:44 +0000 (+0300) Subject: Fix couple static code analyzer warnings X-Git-Tag: NetHack-3.6.1_RC01~442 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4e4d700081697f2f65558dd6fb1c170a7737599;p=nethack Fix couple static code analyzer warnings --- diff --git a/src/artifact.c b/src/artifact.c index bfd576ff4..13e8be981 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -498,7 +498,7 @@ long wp_mask; for (obj = invent; obj; obj = obj->nobj) { if (obj != otmp && obj->oartifact) { art = get_artifact(obj); - if (art->cary.adtyp == dtyp) { + if (art && art->cary.adtyp == dtyp) { mask = (long *) 0; break; } @@ -519,7 +519,8 @@ long wp_mask; for (obj = invent; obj; obj = obj->nobj) if (obj != otmp && obj->oartifact) { art = get_artifact(obj); - spfx &= ~art->cspfx; + if (art) + spfx &= ~art->cspfx; } }