changeset 14399:3a16ff5f6594

(sort_args): Error if option is missing an arg.
author Richard M. Stallman <rms@gnu.org>
date Sun, 28 Jan 1996 04:15:39 +0000
parents ad30f677493e
children 20c5a9797aa8
files src/emacs.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/emacs.c	Sun Jan 28 03:07:38 1996 +0000
+++ b/src/emacs.c	Sun Jan 28 04:15:39 1996 +0000
@@ -1090,6 +1090,8 @@
 	      {
 		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 @@
 		     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];
 		}
 	    }