lib-network
[apps/madmutt.git] / mutt_sasl.c
index 5bc1b70..d5738b6 100644 (file)
@@ -18,7 +18,7 @@
 #include "mutt.h"
 #include "account.h"
 #include "mutt_sasl.h"
-#include "mutt_socket.h"
+#include <lib-network/mutt_socket.h>
 
 #include "lib/debug.h"
 
@@ -116,7 +116,7 @@ static int iptostring (const struct sockaddr *addr, socklen_t addrlen,
   if (ret)
     return getnameinfo_err (ret);
 
-  if (outlen < str_len (hbuf) + str_len (pbuf) + 2)
+  if (outlen < m_strlen(hbuf) + m_strlen(pbuf) + 2)
     return SASL_BUFOVER;
 
   snprintf (out, outlen, "%s;%s", hbuf, pbuf);
@@ -257,7 +257,7 @@ int mutt_sasl_client_new (CONNECTION * conn, sasl_conn_t ** saslconn)
    * just fall back to LOGIN in the IMAP case anyway. If that doesn't
    * work for POP, we can make it a flag or move this code into
    * imap/auth_sasl.c */
-  memset (&secprops, 0, sizeof (secprops));
+  p_clear(&secprops, 1);
   /* Work around a casting bug in the SASL krb4 module */
   secprops.max_ssf = 0x7fff;
   secprops.maxbufsize = M_SASL_MAXBUF;
@@ -331,7 +331,7 @@ int mutt_sasl_interact (sasl_interact_t * interaction)
     if (mutt_get_field (prompt, resp, sizeof (resp), 0))
       return SASL_FAIL;
 
-    interaction->len = str_len (resp) + 1;
+    interaction->len = m_strlen(resp) + 1;
     interaction->result = p_dupstr(resp, interaction->len - 1);
     interaction++;
   }
@@ -429,7 +429,7 @@ static int mutt_sasl_cb_authname (void *context, int id, const char **result,
   }
 
   if (len)
-    *len = str_len (*result);
+    *len = m_strlen(*result);
 
   return SASL_OK;
 }
@@ -449,7 +449,7 @@ static int mutt_sasl_cb_pass (sasl_conn_t * conn, void *context, int id,
   if (mutt_account_getpass (account))
     return SASL_FAIL;
 
-  len = str_len (account->pass);
+  len = m_strlen(account->pass);
 
   *psecret = xmalloc(sizeof(sasl_secret_t) + len);
   (*psecret)->len = len;