]> granicus.if.org Git - nethack/commitdiff
minor nitpicks
authorPatR <rankin@nethack.org>
Sat, 9 Feb 2019 23:33:16 +0000 (15:33 -0800)
committerPatR <rankin@nethack.org>
Sat, 9 Feb 2019 23:33:16 +0000 (15:33 -0800)
A couple of trivial things I noticed while looking at status cleanup.

src/botl.c
win/tty/wintty.c

index a527f64068cc4ec25eb376e19a43b85f7e28d18f..e58f5c398cc7c6539093698ff91a62cf958a8d52 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 botl.c  $NHDT-Date: 1545705812 2018/12/25 02:43:32 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.132 $ */
+/* NetHack 3.6 botl.c  $NHDT-Date: 1549755174 2019/02/09 23:32:54 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.134 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Michael Allison, 2006. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -926,14 +926,12 @@ status_finish()
             free((genericptr_t) blstats[1][i].val), blstats[1][i].val = 0;
 #ifdef STATUS_HILITES
         if (blstats[0][i].thresholds) {
-            struct hilite_s *temp = blstats[0][i].thresholds,
-                            *next = (struct hilite_s *)0;
-            while (temp) {
+            struct hilite_s *temp, *next = 0;
+
+            for (temp = blstats[0][i].thresholds; temp; temp = next) {
                 next = temp->next;
-                free(temp);
-                blstats[0][i].thresholds = (struct hilite_s *)0;
-                blstats[1][i].thresholds = blstats[0][i].thresholds;
-                temp = next;
+                free((genericptr_t) temp);
+                blstats[0][i].thresholds = blstats[1][i].thresholds = 0;
             }
         }
 #endif /* STATUS_HILITES */
index 1f863f159295ce9f1fb72db4fa23bbf0ab075f6a..c56e4576da2eaf1b934fad49d9cd69113cb5fc5f 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 wintty.c        $NHDT-Date: 1549333450 2019/02/05 02:24:10 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.194 $ */
+/* NetHack 3.6 wintty.c        $NHDT-Date: 1549755185 2019/02/09 23:33:05 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.195 $ */
 /* Copyright (c) David Cohrs, 1991                                */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1526,7 +1526,7 @@ boolean free_data;
         tty_menu_item *temp;
 
         while ((temp = cw->mlist) != 0) {
-            cw->mlist = cw->mlist->next;
+            cw->mlist = temp->next;
             if (temp->str)
                 free((genericptr_t) temp->str);
             free((genericptr_t) temp);