--- mailx-8.1.1/quit.c.bug44798 2004-11-03 12:11:04.000000000 +0100
+++ mailx-8.1.1/quit.c 2004-11-15 13:21:36.000000000 +0100
@@ -420,6 +420,7 @@
FILE *obuf, *ibuf, *readstat = NULL;
struct stat statb;
char *tempname;
+ int tempfd;
if (readonly)
return;
@@ -448,8 +449,12 @@
goto done;
ibuf = NULL;
if (stat(mailname, &statb) >= 0 && statb.st_size > mailsize) {
- tempname = tempnam(tmpdir, "mbox");
-
+
+ tempname = (char *)malloc(sizeof(char)*(strlen(tmpdir)+11));
+ strcpy(tempname, tmpdir);
+ strcat(tempname, "mboxXXXXXX");
+ tempfd = mkstemp(tempname);
+
if ((obuf = Fopen(tempname, "w")) == NULL) {
perror(tempname);
relsesigs();