Use m_tempfile and better errors msg
[apps/madmutt.git] / pager.c
diff --git a/pager.c b/pager.c
index b83eaaf..9c2d797 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -17,6 +17,7 @@
 #include <lib-ui/enter.h>
 #include <lib-ui/menu.h>
 #include <lib-ui/sidebar.h>
+#include <lib-mx/mx.h>
 
 #include "mutt.h"
 #include "alias.h"
@@ -28,7 +29,6 @@
 #include "charset.h"
 #include "buffy.h"
 
-#include "mx.h"
 
 #include <imap/imap_private.h>
 
@@ -937,11 +937,9 @@ fill_buffer (FILE * f, off_t *last_pos, off_t offset, unsigned char *buf,
 }
 
 #ifdef USE_NNTP
-#include "mx.h"
-#include "nntp.h"
+#include <nntp/nntp.h>
 #endif
 
-
 static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
                         int flags, ansi_attr * pa, int cnt,
                         int *pspace, int *pvch, int *pcol, int *pspecial)
@@ -1428,7 +1426,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
 
   if (stat (fname, &sb) != 0) {
     mutt_perror (fname);
-    fclose (fp);
+    m_fclose(&fp);
     return (-1);
   }
   unlink (fname);
@@ -2561,7 +2559,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t * extra)
     }
   }
 
-  fclose (fp);
+  m_fclose(&fp);
   if (IsHeader (extra)) {
     Context->msgnotreadyet = -1;
     if (rc == -1)