Use one of the TMPDIR env variable or _PATH_TMP instead of hardcoding

/tmp.

Submitted by:	jedgar
This commit is contained in:
Josef Karthauser
2000-12-17 19:49:07 +00:00
parent 9d1334552f
commit 61ffadb185
+3 -1
View File
@@ -34,6 +34,7 @@
*/
#include <ctype.h>
#include <err.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -172,7 +173,8 @@ int main(int argc, char **argv)
if(!*execfname) snprintf(execfname, sizeof(execfname), "%s", confname);
snprintf(cachename, sizeof(cachename), "%s.cache", confname);
snprintf(tempfname, sizeof(tempfname), "/tmp/crunchgen_%sXXXXXX", confname);
snprintf(tempfname, sizeof(tempfname), "%s/crunchgen_%sXXXXXX",
getenv("TMPDIR") ? getenv("TMPDIR") : _PATH_TMP, confname);
parse_conf_file();
if (list_mode)