mtd/util mkfs.jffs2.c,1.27,1.28

sjhill at cotw.com sjhill at cotw.com
Tue Oct 8 17:07:18 EDT 2002


Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv22636/util

Modified Files:
	mkfs.jffs2.c 
Log Message:
Check to see if user provided any options at all. If they didn't exit
cleanly. Without this patch it SEGFAULTs.


Index: mkfs.jffs2.c
===================================================================
RCS file: /home/cvs/mtd/util/mkfs.jffs2.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- mkfs.jffs2.c	5 Sep 2002 15:21:03 -0000	1.27
+++ mkfs.jffs2.c	8 Oct 2002 21:07:16 -0000	1.28
@@ -1146,6 +1146,11 @@
 	struct stat statbuf;
 	FILE *devtable = NULL;
 
+	if (argc == 1) {
+		fprintf(stderr, helptext);
+		exit(1);
+	}
+
 	while ((opt = getopt_long(argc, argv, "D:p::d:r:s:e:o:blqfh?v", 
 			long_options, &c)) >= 0) {
 		switch (opt) {





More information about the linux-mtd-cvs mailing list