summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Friesenhahn <bfriesen@simple.dallas.tx.us>2011-04-02 19:18:11 +0000
committerBob Friesenhahn <bfriesen@simple.dallas.tx.us>2011-04-02 19:18:11 +0000
commit25b9328e7466dfe8d1c80fbfa284c32f5ef327a6 (patch)
treeca4f9c4787b113ab3ea76e59b07cf39e57ecc824
parentc0e3f8cddebc91966fb590992743aa9d2b49d5b2 (diff)
downloadlibtiff-git-25b9328e7466dfe8d1c80fbfa284c32f5ef327a6.tar.gz
* tools/fax2ps.c (main): Use tmpfile() rather than mkstemp() since
it is much more portable. Tmpfile is included in ISO/IEC 9899:1990 and the WIN32 CRT.
-rw-r--r--ChangeLog6
-rw-r--r--tools/fax2ps.c8
2 files changed, 9 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ac7deb3..bd1916f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-02 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ * tools/fax2ps.c (main): Use tmpfile() rather than mkstemp() since
+ it is much more portable. Tmpfile is included in ISO/IEC
+ 9899:1990 and the WIN32 CRT.
+
2011-03-21 Frank Warmerdam <warmerdam@pobox.com>
* libtiff/tiffiop.h: avoid declaring int64/uint64 on AIX with XLC
diff --git a/tools/fax2ps.c b/tools/fax2ps.c
index 21bbd853..27d9e9c0 100644
--- a/tools/fax2ps.c
+++ b/tools/fax2ps.c
@@ -1,4 +1,4 @@
-/* $Id: fax2ps.c,v 1.22.2.3 2010-12-14 03:17:22 faxguy Exp $" */
+/* $Id: fax2ps.c,v 1.22.2.4 2011-04-02 19:18:12 bfriesen Exp $" */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -377,12 +377,10 @@ main(int argc, char** argv)
int n;
FILE* fd;
char buf[16*1024];
- char temp[1024];
- strcpy(temp, "/tmp/fax2psXXXXXX");
- fd = fdopen(mkstemp(temp), "w+");
+ fd = tmpfile();
if (fd == NULL) {
- fprintf(stderr, "Could not create temp file \"%s\"\n", temp);
+ fprintf(stderr, "Could not obtain temporary file.\n");
exit(-2);
}
#if defined(HAVE_SETMODE) && defined(O_BINARY)