Revert "fix the tempnam warning"

This reverts commit 1e49bad4c3.
This commit is contained in:
DarthArgus
2017-01-22 02:04:54 +00:00
parent 82e0c072ed
commit 42b949c3dc
@@ -118,13 +118,10 @@ File fp;
return;
File temp_fp;
char tmpname[] = "/tmp/templatecompXXXXXX";
int tmpfd = mkstemp(tmpname);
if (tmpfd >= 0 && temp_fp.open(tmpname, "wt"))
if (!temp_fp.open(tmpnam(nullptr), "wt"))
{
fprintf(stderr, "error opening temp file for template header "
"replacement [%s]\n", fp.getFilename().getFullFilename().c_str());
"replacement [%s]\n", temp_fp.getFilename().getFullFilename().c_str());
return;
}
@@ -175,7 +172,7 @@ File fp;
}
else if (temp_fp.puts(buffer) < 0)
{
fprintf(stderr, "error writing to temp header file [%s]\n", fp.getFilename().getFullFilename().c_str());
fprintf(stderr, "error writing to temp header file [%s]\n", temp_fp.getFilename().getFullFilename().c_str());
return;
}
}
@@ -246,11 +243,8 @@ int result;
return -1;
}
File temp_fp;
char tmpname[] = "/tmp/templatecompXXXXXX";
int tmpfd = mkstemp(tmpname);
if (tmpfd >= 0 && temp_fp.open(tmpname, "wt"))
File temp_fp;
if (!temp_fp.open(tmpnam(nullptr), "wt"))
{
fprintf(stderr, "error opening temp file for template source "
"replacement [%s]\n", temp_fp.getFilename().getFullFilename().c_str());