openbsd-ports/textproc/wdiff/patches/patch-wdiff_c
pvalchev e4c810b834 - Remove FreeBSDisms, cleanup Makefile
- Trim DESCR to a reasonable level and format it nicely
- Rename & sync patches to unified diff with update-patches
2002-12-23 09:09:12 +00:00

26 lines
1.0 KiB
Plaintext

$OpenBSD: patch-wdiff_c,v 1.1 2002/12/23 09:09:12 pvalchev Exp $
--- wdiff.c.orig Sun Nov 6 00:57:23 1994
+++ wdiff.c Mon Dec 23 02:06:10 2002
@@ -566,8 +566,8 @@ split_file_into_words (SIDE *side)
this temporary local file. Once done, prepare it for reading.
We do not need the file name itself anymore. */
- tmpnam (side->temp_name);
- side->file = fopen (side->temp_name, "w+");
+ sprintf(side->temp_name, "/tmp/wd.XXXXXXXX");
+ side->file = fdopen (mkstemp(side->temp_name), "w+");
if (side->file == NULL)
error (EXIT_OTHER_REASON, errno, side->temp_name);
if (unlink (side->temp_name) != 0)
@@ -593,8 +593,8 @@ split_file_into_words (SIDE *side)
side->character = getc (side->file);
side->position = 0;
- tmpnam (side->temp_name);
- side->temp_file = fopen (side->temp_name, "w");
+ sprintf(side->temp_name, "/tmp/wd.XXXXXXXX");
+ side->temp_file = fdopen (mkstemp(side->temp_name), "w");
if (side->temp_file == NULL)
error (EXIT_OTHER_REASON, errno, side->temp_name);