summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-09-14 02:09:09 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-09-14 02:09:09 +0000
commitc820d5e9860649bc05cb0d952bcb76621114ce4c (patch)
treeb2e71f11423966575d85bcda31591d0538446efd
parent97c17e4e5551a5b2b7e93e97a323e8068c5bbdb6 (diff)
create temp file safely (issue #5181)
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@764 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xfxotune.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fxotune.c b/fxotune.c
index 26de87a..435ce5b 100755
--- a/fxotune.c
+++ b/fxotune.c
@@ -303,9 +303,10 @@ static int acim_tune(int whichzap, char *dialstr)
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;
}