let m_strformat accept NULL formats.
[apps/madmutt.git] / lib-crypt / crypt-gpgme.c
index 1c6990b..906e56e 100644 (file)
@@ -2308,11 +2308,10 @@ crypt_entry_fmt (char *dest, ssize_t destlen, char op,
     *dest = '\0';
   }
 
-  if (optional)
-    m_strformat (dest, destlen, ifstr, mutt_attach_fmt, data, 0);
-  else if (flags & M_FORMAT_OPTIONAL)
-    m_strformat (dest, destlen, elstr, mutt_attach_fmt, data, 0);
-  return (src);
+  if (flags & M_FORMAT_OPTIONAL)
+    m_strformat(dest, destlen, optional ? ifstr: elstr,
+                mutt_attach_fmt, data, 0);
+  return src;
 }
 
 /* Used by the display fucntion to format a line. */
@@ -2324,8 +2323,7 @@ static void crypt_entry (char *s, ssize_t l, MUTTMENU * menu, int num)
   entry.key = key_table[num];
   entry.num = num + 1;
 
-  m_strformat(s, l, NONULL (PgpEntryFormat), crypt_entry_fmt,
-              (void*)&entry,
+  m_strformat(s, l, PgpEntryFormat, crypt_entry_fmt, &entry,
               option(OPTARROWCURSOR) ? M_FORMAT_ARROWCURSOR : 0);
 }