]> granicus.if.org Git - mutt/commitdiff
Convert mutt_error_history to use buffer pool.
authorKevin McCarthy <kevin@8t8.us>
Thu, 26 Sep 2019 22:23:14 +0000 (15:23 -0700)
committerKevin McCarthy <kevin@8t8.us>
Thu, 26 Sep 2019 22:23:14 +0000 (15:23 -0700)
curs_lib.c

index e0c442045e0550a3a320012b441a34dcf21de22a..a11dc1bc4bedb4bbc7b9e696cf3e223057b1159c 100644 (file)
@@ -526,7 +526,7 @@ static void error_history_dump (FILE *f)
 void mutt_error_history_display ()
 {
   static int in_process = 0;
-  char t[_POSIX_PATH_MAX];
+  BUFFER *t = NULL;
   FILE *f;
 
   if (!ErrorHistSize)
@@ -541,18 +541,22 @@ void mutt_error_history_display ()
     return;
   }
 
-  mutt_mktemp (t, sizeof (t));
-  if ((f = safe_fopen (t, "w")) == NULL)
+  t = mutt_buffer_pool_get ();
+  mutt_buffer_mktemp (t);
+  if ((f = safe_fopen (mutt_b2s (t), "w")) == NULL)
   {
-    mutt_perror (t);
-    return;
+    mutt_perror (mutt_b2s (t));
+    goto cleanup;
   }
   error_history_dump (f);
   safe_fclose (&f);
 
   in_process = 1;
-  mutt_do_pager (_("Error History"), t, 0, NULL);
+  mutt_do_pager (_("Error History"), mutt_b2s (t), 0, NULL);
   in_process = 0;
+
+cleanup:
+  mutt_buffer_pool_release (&t);
 }
 
 static void curses_message (int error, const char *fmt, va_list ap)