replace SKIPWS with a proper inline func with the right API.
[apps/madmutt.git] / handler.c
index 137cc7d..1ed6c23 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -22,6 +22,7 @@
 #include <lib-lib/ascii.h>
 #include <lib-lib/str.h>
 #include <lib-lib/macros.h>
+#include <lib-lib/file.h>
 
 #include "mutt.h"
 #include "recvattach.h"
@@ -327,14 +328,14 @@ void mutt_decode_uuencoded (STATE * s, long len, int istext, iconv_t cd)
     if ((fgets (tmps, sizeof (tmps), s->fpin)) == NULL)
       return;
     len -= m_strlen(tmps);
-    if ((!str_ncmp (tmps, "begin", 5)) && ISSPACE (tmps[5]))
+    if ((!m_strncmp(tmps, "begin", 5)) && ISSPACE (tmps[5]))
       break;
   }
   while (len > 0) {
     if ((fgets (tmps, sizeof (tmps), s->fpin)) == NULL)
       return;
     len -= m_strlen(tmps);
-    if (!str_ncmp (tmps, "end", 3))
+    if (!m_strncmp(tmps, "end", 3))
       break;
     pt = tmps;
     linelen = decode_byte (*pt);
@@ -678,7 +679,7 @@ int text_enriched_handler (BODY * a, STATE * s)
   int tag_len = 0;
   char tag[LONG_STRING + 1];
 
-  memset (&stte, 0, sizeof (stte));
+  p_clear(&stte, 1);
   stte.s = s;
   stte.WrapMargin =
     ((s->flags & M_DISPLAY) ? (COLS - 4) : ((COLS - 4) <
@@ -1103,7 +1104,7 @@ static int autoview_handler (BODY * a, STATE * s)
   p_delete(&fname);
 
   if (entry->command) {
-    strfcpy (command, entry->command, sizeof (command));
+    m_strcpy(command, sizeof(command), entry->command);
 
     /* rfc1524_expand_command returns 0 if the file is required */
     piped =
@@ -1398,7 +1399,7 @@ int mutt_body_handler (BODY * b, STATE * s)
         handler = mutt_signed_handler;
     }
     else if ((WithCrypto & APPLICATION_PGP)
-             && str_casecmp ("encrypted", b->subtype) == 0) {
+             && m_strcasecmp("encrypted", b->subtype) == 0) {
       p = mutt_get_parameter ("protocol", b->parameter);
 
       if (!p)