X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=mutt_socket.c;h=b231454e4dd27f1d31c93fd5e7d15d17fd4579cc;hp=c79d9279fabdc1a35b4d7122d7a72512e637c9f3;hb=d19fed17e7ba2e634d6cf473f4eeafa16fac5495;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281 diff --git a/mutt_socket.c b/mutt_socket.c index c79d927..b231454 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -1,21 +1,12 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1998 Michael R. Elkins * Copyright (C) 1999-2005 Brendan Cully * Copyright (C) 1999-2000 Tommi Komulainen - * - * 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 @@ -32,6 +23,10 @@ #include "mutt_idna.h" +#include "lib/mem.h" +#include "lib/intl.h" +#include "lib/str.h" + #include #include #include @@ -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));