]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
Allow enabling IP info and ASN lookup from the curses interface
authorBaptiste Jonglez <git@bitsofnetworks.org>
Thu, 9 Jun 2016 16:19:29 +0000 (17:19 +0100)
committerBaptiste Jonglez <git@bitsofnetworks.org>
Thu, 9 Jun 2016 16:21:22 +0000 (17:21 +0100)
Toggling IP info and ASN lookup from the curses interface can be done
using 'z' or 'y'.  But it was only allowed if it was first enabled via
a command-line switch (either -z or -y).

select.c

index 62478f4852de5d2df716f17fec299c8c15965ff5..b2c434977fbc844f09f539c49e60bdfeca15de95 100644 (file)
--- a/select.c
+++ b/select.c
@@ -240,15 +240,12 @@ void select_loop(void) {
        break;
 #ifdef IPINFO
       case ActionII:
-       if (ipinfo_no >= 0) {
-         ipinfo_no++;
-          if (ipinfo_no > ipinfo_max)
-            ipinfo_no = 0;
-       }
+       ipinfo_no++;
+       if (ipinfo_no > ipinfo_max)
+         ipinfo_no = 0;
        break;
       case ActionAS:
-       if (ipinfo_no >= 0)
-          ipinfo_no = ipinfo_no?0:ipinfo_max;
+       ipinfo_no = ipinfo_no?0:ipinfo_max;
        break;
 #endif