summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf/gooStub.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/qpdf/gooStub.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/qpdf/gooStub.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/unsupported/qpdf/gooStub.cpp b/noncore/unsupported/qpdf/gooStub.cpp
index cc29685..edbea55 100644
--- a/noncore/unsupported/qpdf/gooStub.cpp
+++ b/noncore/unsupported/qpdf/gooStub.cpp
@@ -31,30 +31,30 @@ GString *appendToPath ( GString *path, char *fileName ) { return new GString (
31 31
32GBool openTempFile ( GString **name, FILE **f, char *mode, char *ext ) 32GBool openTempFile ( GString **name, FILE **f, char *mode, char *ext )
33{ 33{
34 char *s, *p; 34 char *s, *p;
35 int fd; 35 int fd;
36 36
37 if ( !ext ) 37 if ( !ext )
38 ext = ".tmp"; 38 ext = ".tmp";
39 39
40 if (!( s = tmpnam ( 0 ))) 40 if (!( s = tmpnam ( 0 )))
41 return gFalse; 41 return gFalse;
42 42
43 *name = new GString ( "qpdf_" ); 43 *name = new GString ( s );
44 (*name)-> append ( s );
45 44
46 s = (*name)-> getCString ( ); 45 s = (*name)-> getCString ( );
47 if (( p = strrchr ( s, '.' ))) 46 if (( p = strrchr ( s, '.' )))
48 (*name)-> del ( p - s, (*name)-> getLength ( ) - ( p - s )); 47 (*name)-> del ( p - s, (*name)-> getLength ( ) - ( p - s ));
49 48
49 (*name)-> append ( "_qpdf" );
50 (*name)-> append ( ext ); 50 (*name)-> append ( ext );
51 51
52 fd = open ((*name)-> getCString ( ), O_WRONLY | O_CREAT | O_EXCL, 0600 ); 52 fd = open ((*name)-> getCString ( ), O_WRONLY | O_CREAT | O_EXCL, 0600 );
53 53
54 if ( fd < 0 || !( *f = fdopen ( fd, mode ))) { 54 if ( fd < 0 || !( *f = fdopen ( fd, mode ))) {
55 delete *name; 55 delete *name;
56 return gFalse; 56 return gFalse;
57 } 57 }
58 58
59 return gTrue; 59 return gTrue;
60} 60}