Rocco Rutte:
[apps/madmutt.git] / newsrc.c
index 5f52223..10a539f 100644 (file)
--- a/newsrc.c
+++ b/newsrc.c
@@ -1,21 +1,12 @@
 /*
+ * Copyright notice from original mutt:
  * Copyright (C) 1998 Brandon Long <blong@fiction.net>
  * Copyright (C) 1999 Andrej Gritsenko <andrej@lucky.net>
  * Copyright (C) 2000-2001 Vsevolod Volkov <vvv@mutt.org.ua>
- * 
- *     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
@@ -79,7 +70,7 @@ static int nntp_parse_newsrc_line (NNTP_SERVER * news, char *line)
   strfcpy (group, line, len);
   if ((data = (NNTP_DATA *) hash_find (news->newsgroups, group)) == NULL) {
     data =
-      (NNTP_DATA *) safe_calloc (1, sizeof (NNTP_DATA) + strlen (group) + 1);
+      (NNTP_DATA *) safe_calloc (1, sizeof (NNTP_DATA) + mutt_strlen (group) + 1);
     data->group = (char *) data + sizeof (NNTP_DATA);
     strcpy (data->group, group);
     data->nserv = news;
@@ -210,7 +201,7 @@ static int nntp_parse_cacheindex (NNTP_SERVER * news)
     return 0;
   rewind (index);
   while (fgets (buf, sizeof (buf), index)) {
-    buf[strlen (buf) - 1] = 0;  /* strip ending '\n' */
+    buf[mutt_strlen (buf) - 1] = 0;  /* strip ending '\n' */
     if (!mutt_strncmp (buf, "#: ", 3) &&
         !mutt_strcasecmp (buf + 3, news->conn->account.host))
       break;
@@ -233,7 +224,7 @@ static int nntp_parse_cacheindex (NNTP_SERVER * news)
       if ((data = (NNTP_DATA *) hash_find (news->newsgroups, buf)) == NULL) {
         data =
           (NNTP_DATA *) safe_calloc (1,
-                                     sizeof (NNTP_DATA) + strlen (buf) + 1);
+                                     sizeof (NNTP_DATA) + mutt_strlen (buf) + 1);
         data->group = (char *) data + sizeof (NNTP_DATA);
         strcpy (data->group, buf);
         data->nserv = news;
@@ -348,7 +339,7 @@ NNTP_SERVER *mutt_select_newsserver (char *server)
     return NULL;
   }
 
-  buf = p = safe_calloc (strlen (server) + 10, sizeof (char));
+  buf = p = safe_calloc (mutt_strlen (server) + 10, sizeof (char));
   if (url_check_scheme (server) == U_UNKNOWN) {
     strcpy (buf, "nntp://");
     p = strchr (buf, '\0');
@@ -517,8 +508,8 @@ static void nntp_create_newsrc_line (NNTP_DATA * data, char **buf,
     line = *buf + (*pline - line);
   }
   strcpy (line, data->group);
-  len -= strlen (line) + 1;
-  line += strlen (line);
+  len -= mutt_strlen (line) + 1;
+  line += mutt_strlen (line);
   *line++ = data->subscribed ? ':' : '!';
   *line++ = ' ';
   *line = '\0';
@@ -651,7 +642,7 @@ int mutt_newsrc_update (NNTP_SERVER * news)
       continue;
     nntp_create_newsrc_line (data, &buf, &line, &llen);
     dprint (2, (debugfile, "Added to newsrc: %s", line));
-    line += strlen (line);
+    line += mutt_strlen (line);
   }
   /* newrc being fully rewritten */
   if (news->newsrc &&
@@ -677,7 +668,7 @@ static FILE *mutt_mkname (char *s)
     return fp;
 
   nntp_cache_expand (buf, "cache-XXXXXX");
-  pc = buf + strlen (buf) - 12; /* positioning to "cache-XXXXXX" */
+  pc = buf + mutt_strlen (buf) - 12; /* positioning to "cache-XXXXXX" */
   if ((fd = mkstemp (buf)) == -1)
     return NULL;
   strcpy (s, pc);               /* generated name */
@@ -884,7 +875,7 @@ NNTP_DATA *mutt_newsgroup_subscribe (NNTP_SERVER * news, char *group)
     return NULL;
   if (!(data = (NNTP_DATA *) hash_find (news->newsgroups, group))) {
     data =
-      (NNTP_DATA *) safe_calloc (1, sizeof (NNTP_DATA) + strlen (group) + 1);
+      (NNTP_DATA *) safe_calloc (1, sizeof (NNTP_DATA) + mutt_strlen (group) + 1);
     data->group = (char *) data + sizeof (NNTP_DATA);
     strcpy (data->group, group);
     data->nserv = news;