[Scummvm-cvs-logs] CVS: tools extract.c,1.22,1.23

Jonathan Gray khalek at users.sourceforge.net
Fri Sep 12 04:31:14 CEST 2003


Update of /cvsroot/scummvm/tools
In directory sc8-pr-cvs1:/tmp/cvs-serv22121

Modified Files:
	extract.c 
Log Message:
file handles should always be checked after fopen calls...

Index: extract.c
===================================================================
RCS file: /cvsroot/scummvm/tools/extract.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- extract.c	8 Sep 2003 23:09:19 -0000	1.22
+++ extract.c	12 Sep 2003 11:10:52 -0000	1.23
@@ -454,8 +454,16 @@
 	}
 
 	output_idx = fopen("monster.idx", "wb");
+	if (!output_idx) {
+		printf("Can't open file monster.idx for write!\n");
+		exit(-1);
+	}
 	output_snd = fopen("monster.dat", "wb");
-
+	if (!output_snd) {
+		printf("Can't open file monster.dat for write!\n");
+		exit(-1);
+	}
+	
 	/* Get the 'SOU ....' header */
 	get_string(8);
 	if (strncmp(buf, f_hdr, 8)) {





More information about the Scummvm-git-logs mailing list