(valid_options): Don't segfault on `stty erase -'.
authorJim Meyering <jim@meyering.net>
Wed, 21 Jun 2000 07:29:03 +0000 (07:29 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 21 Jun 2000 07:29:03 +0000 (07:29 +0000)
src/stty.c

index 3bbf0a6..c263747 100644 (file)
@@ -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))