openbsd-ports/print/bibview/patches/patch-ctl_open_c

24 lines
706 B
Plaintext

Index: ctl_open.c
--- ctl_open.c.orig
+++ ctl_open.c
@@ -20,6 +20,7 @@
/* */
/*********************************************************************/
+#include <stdlib.h>
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
@@ -112,9 +113,9 @@ char *tempName;
bp->tempfile = (char *)XtMalloc(strlen(tempName)+1);
strcpy(bp->tempfile,tempName);
#else
- bp->tempfile = (char *)tempnam(NULL, NULL);
+ bp->tempfile = strdup("/tmp/aa.XXXXXXXX");
#endif
- tempFile = fopen(bp->tempfile, "w" );
+ tempFile = fdopen(mkstemp(bp->tempfile), "w" );
fclose(tempFile);
/* display window for bib */