openbsd-ports/textproc/xpdf/patches/patch-aa
1999-09-15 21:59:56 +00:00

27 lines
675 B
Plaintext

--- xpdf/Stream.cc.orig Wed Sep 15 13:01:21 1999
+++ xpdf/Stream.cc Wed Sep 15 13:02:02 1999
@@ -836,6 +836,7 @@
void LZWStream::reset() {
FILE *f;
+ int fd;
str->reset();
bufPtr = bufEnd = buf;
@@ -857,12 +858,13 @@
strcpy(zCmd, uncompressCmd);
strcat(zCmd, " ");
zName = zCmd + strlen(zCmd);
- tmpnam(zName);
+ strncat(zName,"/tmp/xpdf.XXXXXX",strlen("/tmp/xpdf.XXXXXX"));
#ifdef _MSC_VER
zName[strlen(zName) - 2] = '\0';
#endif
strcat(zName, ".Z");
- if (!(f = fopen(zName, "wb"))) {
+ fd=mkstemps(zName,strlen(".Z"));
+ if (!(f = fdopen(fd, "w"))) {
error(getPos(), "Couldn't open temporary file '%s'", zName);
return;
}