From c820d5e9860649bc05cb0d952bcb76621114ce4c Mon Sep 17 00:00:00 2001 From: kpfleming Date: Wed, 14 Sep 2005 02:09:09 +0000 Subject: create temp file safely (issue #5181) git-svn-id: http://svn.digium.com/svn/zaptel/trunk@764 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- fxotune.c | 5 +++-- 1 file 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; } -- cgit v1.2.3