Commit 797c2ef9 authored by Michael Niedermayer's avatar Michael Niedermayer

av_tempfile: try tempnam(NULL) first

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9329d36a
......@@ -133,7 +133,9 @@ void av_file_unmap(uint8_t *bufptr, size_t size)
int av_tempfile(const char *prefix, char **filename) {
int fd=-1;
#if !HAVE_MKSTEMP
void *ptr= tempnam(".", prefix);
void *ptr= tempnam(NULL, prefix);
if(!ptr)
ptr= tempnam(".", prefix);
*filename = av_strdup(ptr);
#undef free
free(ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment