[netfilter-cvslog] r3359 - trunk/nfsim/tools

rusty at netfilter.org rusty at netfilter.org
Tue Dec 14 02:04:09 CET 2004


Author: rusty at netfilter.org
Date: 2004-12-14 02:04:08 +0100 (Tue, 14 Dec 2004)
New Revision: 3359

Modified:
   trunk/nfsim/tools/proc.c
Log:
<acidfu> rusty, I can't figureout in the code the bug is, but when I enter 'proc cat' i'm getting a segmentation fault every time.


Modified: trunk/nfsim/tools/proc.c
===================================================================
--- trunk/nfsim/tools/proc.c	2004-12-14 00:59:40 UTC (rev 3358)
+++ trunk/nfsim/tools/proc.c	2004-12-14 01:04:08 UTC (rev 3359)
@@ -132,21 +132,6 @@
 	return -1;
 }
 	
-static bool proc(int argc, char **argv)
-{
-
-	if (argc == 1) {
-		proc_tree(&proc_root, 0);
-		return true;
-	}
-
-	if (!strcmp(argv[1], "cat")) {
-		proc_cat(argv[2]);
-	}
-
-	return true;
-}
-
 static void proc_help(int argc, char **argv)
 {
 #include "proc-help:proc"
@@ -169,6 +154,25 @@
 */
 }
 
+static bool proc(int argc, char **argv)
+{
+
+	if (argc == 1) {
+		proc_tree(&proc_root, 0);
+		return true;
+	}
+
+	if (!strcmp(argv[1], "cat")) {
+		if (argc != 3) {
+			proc_help(argc, argv);
+			return false;
+		}
+		proc_cat(argv[2]);
+	}
+
+	return true;
+}
+
 static void init(void)
 {
 	tui_register_command("proc", proc, proc_help);




More information about the netfilter-cvslog mailing list