Use good m_ functions, because it smell like a flower, version 2.
[apps/madmutt.git] / lib-ui / query.c
index 11fa388..2ce8961 100644 (file)
@@ -7,15 +7,8 @@
  * please see the file GPL in the top level source directory.
  */
 
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-
 #include <lib-lib/lib-lib.h>
+
 #include <lib-sys/unix.h>
 
 #include <lib-ui/menu.h>
@@ -83,7 +76,7 @@ static QUERY *run_query (char *s, int quiet)
   int l;
 
 
-  mutt_expand_file_fmt (cmd, sizeof (cmd), QueryCmd, s);
+  m_quotefile_fmt(cmd, sizeof (cmd), QueryCmd, s);
 
   if ((thepid = mutt_create_filter (cmd, NULL, &fp, NULL)) < 0) {
     return 0;
@@ -126,7 +119,7 @@ static QUERY *run_query (char *s, int quiet)
     }
   }
   p_delete(&buf);
-  fclose (fp);
+  m_fclose(&fp);
   if (mutt_wait_filter (thepid)) {
     if (!quiet)
       mutt_error ("%s", msg);
@@ -441,7 +434,7 @@ static void query_menu (char *buf, ssize_t buflen, QUERY * results, int retbuf)
             address_t *tmpa = result_to_addr (QueryTable[i].data);
 
             mutt_addrlist_to_local (tmpa);
-            strcat (buf, ", "); /* __STRCAT_CHECKED__ */
+            m_strcat(buf, buflen, ", ");
             rfc822_write_address ((char *) buf + curpos + 1,
                                   buflen - curpos - 1, tmpa, 0);
             curpos = m_strlen(buf);