Rocco Rutte
[apps/madmutt.git] / mutt_socket.c
index c79d927..b231454 100644 (file)
@@ -1,21 +1,12 @@
 /*
+ * Copyright notice from original mutt:
  * Copyright (C) 1998 Michael R. Elkins <me@mutt.org>
  * Copyright (C) 1999-2005 Brendan Cully <brendan@kublai.com>
  * Copyright (C) 1999-2000 Tommi Komulainen <Tommi.Komulainen@iki.fi>
- * 
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
- * 
- *     This program is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- * 
- *     You should have received a copy of the GNU General Public License
- *     along with this program; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
  */
 
 #if HAVE_CONFIG_H
 
 #include "mutt_idna.h"
 
+#include "lib/mem.h"
+#include "lib/intl.h"
+#include "lib/str.h"
+
 #include <unistd.h>
 #include <netinet/in.h>
 #include <netdb.h>
@@ -113,7 +108,7 @@ int mutt_socket_write_d (CONNECTION * conn, const char *buf, int dbg)
     return -1;
   }
 
-  len = mutt_strlen (buf);
+  len = safe_strlen (buf);
   if ((rc = conn->conn_write (conn, buf, len)) < 0) {
     dprint (1, (debugfile,
                 "mutt_socket_write: error writing, closing socket\n"));
@@ -184,7 +179,7 @@ int mutt_socket_readln_d (char *buf, size_t buflen, CONNECTION * conn,
 
   dprint (dbg, (debugfile, "< %s\n", buf));
 
-  /* number of bytes read, not strlen */
+  /* number of bytes read, not safe_strlen */
   return i + 1;
 }
 
@@ -285,7 +280,7 @@ static int socket_preconnect (void)
   int rc;
   int save_errno;
 
-  if (mutt_strlen (Preconnect)) {
+  if (safe_strlen (Preconnect)) {
     dprint (2, (debugfile, "Executing preconnect: %s\n", Preconnect));
     rc = mutt_system (Preconnect);
     dprint (2, (debugfile, "Preconnect result: %d\n", rc));