[Initng-svn] r1681 - initng/plugins/ngc2

svn at initng.thinktux.net svn at initng.thinktux.net
Mon Sep 26 10:51:37 CEST 2005


Author: jimmy
Date: Mon Sep 26 10:27:24 2005
New Revision: 1681

Modified:
   initng/plugins/ngc2/initng_ngc2.c
Log:
Fixed bug: Segfault when calling command that does not exists.


Modified: initng/plugins/ngc2/initng_ngc2.c
==============================================================================
--- initng/plugins/ngc2/initng_ngc2.c	(original)
+++ initng/plugins/ngc2/initng_ngc2.c	Mon Sep 26 10:27:24 2005
@@ -144,11 +144,6 @@
     else
         return;
 
-    if (tmp_cmd->opt_type == REQUIRES_OPT && strlen(header.o) < 1)
-    {
-        F_("Command %c - %s, requires an option!\n", header.c, header.l);
-        return;
-    }
 
     if (!tmp_cmd || tmp_cmd->com_type == 0)
     {
@@ -161,6 +156,13 @@
         return;
     }
 
+    if (tmp_cmd->opt_type == REQUIRES_OPT && strlen(header.o) < 1)
+    {
+        F_("Command %c - %s, requires an option!\n", header.c, header.l);
+        return;
+    }
+
+
     /* set the result statics. */
     result.c = tmp_cmd->command_id;
     result.t = tmp_cmd->com_type;


More information about the Initng-svn mailing list