X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=nntp.c;h=efd887fefdc4c76cdd877956513529cce9b5cffc;hb=6650f84c0990f8cd61814f9a43aea5bc870e57ff;hp=64cc4d2aa3561d6cd7e89d29ef5f346546a9e25b;hpb=df70e07e24add1869bcc9b7af2277d9d0c09a281;p=apps%2Fmadmutt.git diff --git a/nntp.c b/nntp.c index 64cc4d2..efd887f 100644 --- a/nntp.c +++ b/nntp.c @@ -1,21 +1,12 @@ /* + * Copyright notice from original mutt: * Copyright (C) 1998 Brandon Long * Copyright (C) 1999 Andrej Gritsenko * Copyright (C) 2000-2002 Vsevolod Volkov - * - * 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., 675 Mass Ave, Cambridge, MA 02139, 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. */ #ifdef HAVE_CONFIG_H @@ -336,7 +327,7 @@ static int mutt_nntp_fetch (NNTP_DATA * nntp_data, char *query, char *msg, strfcpy (inbuf + lenbuf, p, sizeof (buf)); if (chunk >= sizeof (buf)) { - lenbuf += strlen (p); + lenbuf += mutt_strlen (p); } else { line++; @@ -831,7 +822,7 @@ int nntp_open_mailbox (CONTEXT * ctx) /* create NNTP-specific state struct if nof found in list */ if ((nntp_data = (NNTP_DATA *) hash_find (serv->newsgroups, buf)) == NULL) { - nntp_data = safe_calloc (1, sizeof (NNTP_DATA) + strlen (buf) + 1); + nntp_data = safe_calloc (1, sizeof (NNTP_DATA) + mutt_strlen (buf) + 1); nntp_data->group = (char *) nntp_data + sizeof (NNTP_DATA); strcpy (nntp_data->group, buf); hash_insert (serv->newsgroups, nntp_data->group, nntp_data, 0); @@ -1018,7 +1009,7 @@ int nntp_post (const char *msg) buf[0] = '.'; buf[1] = '\0'; while (fgets (buf + 1, sizeof (buf) - 2, f) != NULL) { - len = strlen (buf); + len = mutt_strlen (buf); if (buf[len - 1] == '\n') { buf[len - 1] = '\r'; buf[len] = '\n'; @@ -1032,7 +1023,7 @@ int nntp_post (const char *msg) } fclose (f); - if (buf[strlen (buf) - 1] != '\n') + if (buf[mutt_strlen (buf) - 1] != '\n') mutt_socket_write_d (nntp_data->nserv->conn, "\r\n", M_SOCK_LOG_HDR); mutt_socket_write_d (nntp_data->nserv->conn, ".\r\n", M_SOCK_LOG_HDR); if (mutt_socket_readln (buf, sizeof (buf), nntp_data->nserv->conn) < 0) { @@ -1243,7 +1234,7 @@ static int add_group (char *buf, void *serv) return 0; if ((nntp_data = (NNTP_DATA *) hash_find (s->newsgroups, group)) == NULL) { n++; - nntp_data = safe_calloc (1, sizeof (NNTP_DATA) + strlen (group) + 1); + nntp_data = safe_calloc (1, sizeof (NNTP_DATA) + mutt_strlen (group) + 1); nntp_data->group = (char *) nntp_data + sizeof (NNTP_DATA); strcpy (nntp_data->group, group); nntp_data->nserv = s;