]> granicus.if.org Git - nethack/commitdiff
Fix an implicit-fallthrough and maybe-uninitialized warning
authorPatric Mueller <bhaak@gmx.net>
Sun, 15 Nov 2020 15:07:43 +0000 (16:07 +0100)
committerPatric Mueller <bhaak@gmx.net>
Sun, 15 Nov 2020 15:07:43 +0000 (16:07 +0100)
src/dokick.c

index 81ed6c314a2bad16abbf2a615fc0c9bfd3ff9506..80cdcaa5061fdd69277de831d1252136811afc1d 100644 (file)
@@ -1617,7 +1617,7 @@ obj_delivery(near_hero)
 boolean near_hero;
 {
     register struct obj *otmp, *otmp2;
-    register int nx, ny;
+    int nx = 0, ny = 0;
     int where;
     boolean nobreak, noscatter;
     stairway *stway;
@@ -1650,6 +1650,7 @@ boolean near_hero;
         switch (where) {
         case MIGR_LADDER_UP:
             isladder = TRUE;
+            /*FALLTHRU*/
         case MIGR_STAIRS_UP:
         case MIGR_SSTAIRS:
             if ((stway = stairway_find_from(&fromdlev, isladder)) != 0) {
@@ -1657,7 +1658,6 @@ boolean near_hero;
                 nx = stway->sy;
             }
             break;
-            break;
         case MIGR_WITH_HERO:
             nx = u.ux, ny = u.uy;
             break;