summaryrefslogtreecommitdiff
path: root/rdoff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-09-12 02:24:53 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-09-12 02:24:53 +0000
commita607d27eb9fb97d89f635fe0c7b579d0d053b272 (patch)
tree3eadd25fcefdcd7025cbb5ddf80d306423a70f2c /rdoff
parentbfebdb0a071fe4f657e9505331ea8cb210c9d9b9 (diff)
downloadnasm-a607d27eb9fb97d89f635fe0c7b579d0d053b272.tar.gz
nasm-a607d27eb9fb97d89f635fe0c7b579d0d053b272.tar.bz2
nasm-a607d27eb9fb97d89f635fe0c7b579d0d053b272.zip
Use tmpfile() instead of tmpnam()
Diffstat (limited to 'rdoff')
-rw-r--r--rdoff/rdflib.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/rdoff/rdflib.c b/rdoff/rdflib.c
index cdbc20a..edf4a22 100644
--- a/rdoff/rdflib.c
+++ b/rdoff/rdflib.c
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
int i;
long l;
time_t t;
- char tmptempl[L_tmpnam], rdbuf[10];
+ char rdbuf[10];
_argv = argv;
@@ -319,8 +319,7 @@ int main(int argc, char **argv)
}
}
- tmpnam(tmptempl);
- fptmp = fopen(tmptempl,"wb");
+ fptmp = tmpfile();
if (! fptmp)
{
fprintf(stderr,"rdflib: could not open temporary file\n");
@@ -333,7 +332,7 @@ int main(int argc, char **argv)
l = ftell(fp);
fseek(fp, 0, SEEK_SET);
copybytes(fp, fptmp, l);
- freopen(tmptempl, "rb", fptmp); /* reopen files */
+ rewind(fptmp); /* reopen files */
freopen(argv[2], "wb", fp);
while (! feof(fptmp) ) {
@@ -397,7 +396,6 @@ int main(int argc, char **argv)
fclose(fp);
fclose(fptmp);
- unlink(tmptempl);
break;
default: