diff options
author | bfriesen <bfriesen> | 2011-04-02 19:18:11 +0000 |
---|---|---|
committer | bfriesen <bfriesen> | 2011-04-02 19:18:11 +0000 |
commit | a0534dfa9ed9353a1c153513a97680379408063a (patch) | |
tree | 9d67aad2d7a6153ae0bd9af5c7eaab3602572648 | |
parent | 1460253d342fe13661a179620652b3b37e9c4804 (diff) | |
download | libtiff-a0534dfa9ed9353a1c153513a97680379408063a.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-- | ChangeLog | 6 | ||||
-rw-r--r-- | tools/fax2ps.c | 8 |
2 files changed, 9 insertions, 5 deletions
@@ -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) |