Module Name:    othersrc
Committed By:   agc
Date:           Wed Aug  3 01:09:59 UTC 2011

Modified Files:
        othersrc/external/bsd/mat/dist: frontends.c

Log Message:
check for 'f' argument being given without a corresponding file


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/mat/dist/frontends.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/mat/dist/frontends.c
diff -u othersrc/external/bsd/mat/dist/frontends.c:1.4 othersrc/external/bsd/mat/dist/frontends.c:1.5
--- othersrc/external/bsd/mat/dist/frontends.c:1.4	Fri Jul 15 05:33:42 2011
+++ othersrc/external/bsd/mat/dist/frontends.c	Wed Aug  3 01:09:58 2011
@@ -219,6 +219,10 @@
 		(void) fprintf(stderr, "No action specified\n");
 		return 0;
 	}
+	if (f == NULL) {
+		(void) fprintf(stderr, "No file specified\n");
+		return 0;
+	}
 	if (reading(action) && strcmp(f, "-") == 0) {
 		/* read archive from stdin */
 		if ((fd = dostdin(TMPDIR, f = temp, sizeof(temp))) < 0) {
@@ -365,6 +369,10 @@
 			(void) fprintf(stderr, "Unknown flag \"%c\"\n", i);
 		}
 	}
+	if (archive == NULL) {
+		(void) fprintf(stderr, "No file specified\n");
+		return 0;
+	}
 	if (reading(action) && strcmp(archive, "-") == 0) {
 		/* read archive from stdin */
 		if ((fd = dostdin(TMPDIR, archive = temp, sizeof(temp))) < 0) {

Reply via email to