changeset 11157:620fd38579d8

(sort_args): Skip strncmp if longname is a null pointer.
author Karl Heuer <kwzh@gnu.org>
date Fri, 31 Mar 1995 00:09:19 +0000
parents 31a046cedfc8
children b9376f3450bb
files src/emacs.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/emacs.c	Thu Mar 30 23:38:23 1995 +0000
+++ b/src/emacs.c	Fri Mar 31 00:09:19 1995 +0000
@@ -1047,8 +1047,11 @@
 	      if (equals != 0)
 		thislen = equals - argv[from];
 
-	      for (i = 0; i < sizeof (standard_args) / sizeof (standard_args[0]); i++)
-		if (!strncmp (argv[from], standard_args[i].longname, thislen))
+	      for (i = 0;
+		   i < sizeof (standard_args) / sizeof (standard_args[0]); i++)
+		if (standard_args[i].longname
+		    && !strncmp (argv[from], standard_args[i].longname,
+				 thislen))
 		  {
 		    if (match == -1)
 		      match = i;