diff options
| author | Richard M. Stallman <rms@gnu.org> | 1996-01-28 04:15:39 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1996-01-28 04:15:39 +0000 |
| commit | fd76ec52b3eff15330a1f95488d8c899ecf4ff25 (patch) | |
| tree | a92b757f7f8b83230b9abf24c47710f2f7ce531a | |
| parent | a3fc4dee2cb3cc50362d98b8d062e85b974d6001 (diff) | |
| download | emacs-fd76ec52b3eff15330a1f95488d8c899ecf4ff25.tar.gz | |
(sort_args): Error if option is missing an arg.
| -rw-r--r-- | src/emacs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/emacs.c b/src/emacs.c index 90c66cd6cbe..4297163dde0 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1090,6 +1090,8 @@ sort_args (argc, argv) { options[from] = standard_args[i].nargs; priority[from] = standard_args[i].priority; + if (from + standard_args[i].nargs >= argc) + fatal ("Option `%s' requires an argument\n", argv[from]); from += standard_args[i].nargs; goto done; } @@ -1126,6 +1128,8 @@ sort_args (argc, argv) this option uses just one argv element. */ if (equals != 0) options[from] = 0; + if (from + options[from] >= argc) + fatal ("Option `%s' requires an argument\n", argv[from]); from += options[from]; } } |
