diff options
author | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-09-14 02:09:09 +0000 |
---|---|---|
committer | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-09-14 02:09:09 +0000 |
commit | c820d5e9860649bc05cb0d952bcb76621114ce4c (patch) | |
tree | b2e71f11423966575d85bcda31591d0538446efd | |
parent | 97c17e4e5551a5b2b7e93e97a323e8068c5bbdb6 (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-x | fxotune.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; } |