- fix buglet introduced in r17351 in find_param(). Closes #1193
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Sun, 4 Feb 2007 11:13:57 +0000 (11:13 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Sun, 4 Feb 2007 11:13:57 +0000 (11:13 -0000)
coreutils/stty.c

index c354aac9c37e0384a023159088fd976cdd40afab..15cb05293995e9245f13e68e206550e45d81bc55 100644 (file)
@@ -568,10 +568,11 @@ static int find_param(const char * const name)
                NULL
        };
        int i = index_in_str_array(params, name);
-       if (i) {
-               if (!(i == 4 || i == 5))
-                       i |= 0x80;
-       }
+       if (i < 0)
+               return 0;
+       if (!(i == 4 || i == 5))
+               i |= 0x80;
+
        return i;
 }