]> granicus.if.org Git - nethack/commitdiff
Fix couple static code analyzer warnings
authorPasi Kallinen <paxed@alt.org>
Wed, 2 Aug 2017 16:48:44 +0000 (19:48 +0300)
committerPasi Kallinen <paxed@alt.org>
Wed, 2 Aug 2017 16:48:44 +0000 (19:48 +0300)
src/artifact.c

index bfd576ff4a729ab4dc50cd319efd50279e308aaf..13e8be981f919a9c0ce5ace4fa77f03248d1c771 100644 (file)
@@ -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;
             }
     }