summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-06-21 07:29:03 +0000
committerJim Meyering <jim@meyering.net>2000-06-21 07:29:03 +0000
commite1e0683c8209f04f51a72957a11b2b203506614a (patch)
tree168f1aaf0d11316256f21f4f9c7f8d37eb902784
parent4be8db746e1e8090834c68c4879fea10c104966d (diff)
downloadcoreutils-e1e0683c8209f04f51a72957a11b2b203506614a.tar.xz
(valid_options): Don't segfault on `stty erase -'.
-rw-r--r--src/stty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stty.c b/src/stty.c
index 3bbf0a6f1..c26374717 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -680,7 +680,7 @@ valid_options (char *opt, const char *valid_opts,
{
char ch;
- if (*opt++ != '-')
+ if (*opt++ != '-' || *opt == 0)
return 0;
while ((ch = *opt))