openbsd-ports/mail/mh/patches/patch-am
1998-04-30 23:51:57 +00:00

23 lines
574 B
Plaintext

--- sbr/m_scratch.c.orig Tue Nov 30 20:01:24 1993
+++ sbr/m_scratch.c Wed Apr 29 22:08:32 1998
@@ -11,14 +11,18 @@
register char *cp;
static char buffer[BUFSIZ],
tmpfil[BUFSIZ];
+ int i;
(void) sprintf (tmpfil, "%sXXXXXX", template);
- (void) mktemp (tmpfil);
+ i = mkstemp (tmpfil);
+ if (i == -1 )
+ return NULL;
if ((cp = r1bindex (file, '/')) == file)
(void) strcpy (buffer, tmpfil);
else
(void) sprintf (buffer, "%.*s%s", cp - file, file, tmpfil);
(void) unlink (buffer);
+ close(i);
return buffer;
}