summaryrefslogtreecommitdiff
path: root/coreutils/stty.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2007-02-04 11:16:21 +0000
committerBernhard Reutner-Fischer2007-02-04 11:16:21 +0000
commitbbbb7e02fcd116390eaa86d701b674ca3f3312f6 (patch)
tree069dcd61b30c29c9cfe85b569d501893bf943681 /coreutils/stty.c
parent1ca74185c497710e2949c3b5ea97897d9b96c758 (diff)
downloadbusybox-bbbb7e02fcd116390eaa86d701b674ca3f3312f6.zip
busybox-bbbb7e02fcd116390eaa86d701b674ca3f3312f6.tar.gz
- pull r17757 from trunk: fix stty's fix_param(). Closes #1193
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r--coreutils/stty.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 4e665bc..51aa66d 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -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;
}