reindent and optimizations in BUFFER* struct.
[apps/madmutt.git] / attach.c
index 0daba27..5480710 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -566,18 +566,18 @@ int mutt_view_attachment (FILE * fp, BODY * a, int flag, HEADER * hdr,
 
   if (use_pager) {
     pager_t info;
+    p_clear(&info, 1);
 
-    memset (&info, 0, sizeof (info));
-    info.fp = fp;
+    info.fp  = fp;
     info.bdy = a;
     info.ctx = Context;
     info.idx = idx;
     info.idxlen = idxlen;
     info.hdr = hdr;
 
-    rc = mutt_do_pager (descrip, pagerfile,
-                        M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE :
-                                              0), &info);
+    rc = mutt_do_pager(descrip, pagerfile,
+                       M_PAGER_ATTACHMENT | (is_message ? M_PAGER_MESSAGE : 0),
+                       &info);
     *pagerfile = '\0';
   }
   else
@@ -616,16 +616,13 @@ int mutt_pipe_attachment (FILE * fp, BODY * b, const char *path,
 
   if (fp) {
     /* recv case */
-
     STATE s;
-
-    memset (&s, 0, sizeof (STATE));
+    p_clear(&s, 1);
 
     if (outfile && *outfile)
-      thepid =
-        mutt_create_filter_fd (path, &s.fpout, NULL, NULL, -1, out, -1);
+      thepid = mutt_create_filter_fd(path, &s.fpout, NULL, NULL, -1, out, -1);
     else
-      thepid = mutt_create_filter (path, &s.fpout, NULL, NULL);
+      thepid = mutt_create_filter(path, &s.fpout, NULL, NULL);
 
     if (thepid < 0) {
       mutt_perror (_("Can't create filter"));
@@ -754,8 +751,8 @@ int mutt_save_attachment (FILE * fp, BODY * m, char *path, int flags,
       /* In recv mode, extract from folder and decode */
 
       STATE s;
+      p_clear(&s, 1);
 
-      memset (&s, 0, sizeof (s));
       if ((s.fpout = mutt_save_attachment_open (path, flags)) == NULL) {
         mutt_perror ("fopen");
         return (-1);
@@ -808,7 +805,7 @@ int mutt_decode_save_attachment (FILE * fp, BODY * m, char *path,
   BODY *saved_parts = NULL;
   HEADER *saved_hdr = NULL;
 
-  memset (&s, 0, sizeof (s));
+  p_clear(&s, 1);
   s.flags = displaying;
 
   if (flags == M_SAVE_APPEND)