openbsd-ports/news/tin/patches/patch-ac
1998-09-08 05:43:35 +00:00

18 lines
469 B
Plaintext

--- src/open.c.orig Fri Aug 14 11:34:01 1998
+++ src/open.c Mon Sep 7 21:55:05 1998
@@ -630,11 +630,12 @@
char tempfile[PATH_LEN];
int count = 0;
struct stat sb;
+ int fdfd;
sprintf (tempfile, "%stin_nntpXXXXXX", TMPDIR);
- mktemp (tempfile);
+ fdfd = mkstemp (tempfile);
- if ((fp = fopen (tempfile, "w")) == (FILE *) 0) {
+ if ((fp = fdopen (fdfd, "w")) == (FILE *) 0) {
perror_message (txt_article_cannot_open, tempfile);
return ((FILE *) 0);
}