[Asterisk-cvs] zaptel fxotune.c,1.23,1.24

kpfleming kpfleming
Tue Sep 13 22:10:35 CDT 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv31302

Modified Files:
	fxotune.c 
Log Message:
create temp file safely (issue #5181)


Index: fxotune.c
===================================================================
RCS file: /usr/cvsroot/zaptel/fxotune.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- fxotune.c	26 Aug 2005 16:55:25 -0000	1.23
+++ fxotune.c	14 Sep 2005 02:09:09 -0000	1.24
@@ -303,9 +303,10 @@
 	float acim_results[16];
 
 
-	outfile = fopen("/tmp/fxotune.vals", "w");
+	outfile = tmpfile();
 	if (!outfile) {
-		fprintf(stdout, "Cannot create /tmp/txotune.vals\n");
+		fprintf(stdout, "Cannot create temporary file: %d (%s)\n", 
+                    errno, strerror(errno));
 		return -1;
 	}
 




More information about the svn-commits mailing list