X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=nntp%2Fnewsrc.c;h=32df8520a902d0256ee76d03a2ede337df099b1d;hb=cdd5dd2b406b2af4359f7b1e7360d0c9aba13777;hp=22ff5a2262c60d14586b135ee90da92c99352da9;hpb=203e950e3d3c76795fa49895d040f732adad2049;p=apps%2Fmadmutt.git diff --git a/nntp/newsrc.c b/nntp/newsrc.c index 22ff5a2..32df852 100644 --- a/nntp/newsrc.c +++ b/nntp/newsrc.c @@ -18,7 +18,6 @@ #include "sort.h" #include "mx.h" #include "mime.h" -#include "mailbox.h" #include "nntp.h" #include "rfc822.h" #include "rfc1524.h" @@ -74,7 +73,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) + mutt_strlen (group) + 1); + (NNTP_DATA *) safe_calloc (1, sizeof (NNTP_DATA) + safe_strlen (group) + 1); data->group = (char *) data + sizeof (NNTP_DATA); strcpy (data->group, group); data->nserv = news; @@ -205,9 +204,9 @@ static int nntp_parse_cacheindex (NNTP_SERVER * news) return 0; rewind (index); while (fgets (buf, sizeof (buf), index)) { - buf[mutt_strlen (buf) - 1] = 0; /* strip ending '\n' */ - if (!mutt_strncmp (buf, "#: ", 3) && - !mutt_strcasecmp (buf + 3, news->conn->account.host)) + buf[safe_strlen (buf) - 1] = 0; /* strip ending '\n' */ + if (!safe_strncmp (buf, "#: ", 3) && + !safe_strcasecmp (buf + 3, news->conn->account.host)) break; } while (fgets (buf, sizeof (buf), index)) { @@ -217,10 +216,10 @@ static int nntp_parse_cacheindex (NNTP_SERVER * news) if (!*cp) continue; cp[0] = 0; - if (!mutt_strcmp (buf, "#:")) + if (!safe_strcmp (buf, "#:")) break; sscanf (cp + 1, "%s %d %d", file, &l, &m); - if (!mutt_strcmp (buf, "ALL")) { + if (!safe_strcmp (buf, "ALL")) { news->cache = safe_strdup (file); news->newgroups_time = m; } @@ -228,7 +227,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) + mutt_strlen (buf) + 1); + sizeof (NNTP_DATA) + safe_strlen (buf) + 1); data->group = (char *) data + sizeof (NNTP_DATA); strcpy (data->group, buf); data->nserv = news; @@ -266,7 +265,7 @@ const char *nntp_format_str (char *dest, size_t destlen, char op, switch (op) { case 's': strncpy (fn, NewsServer, sizeof (fn) - 1); - mutt_strlower (fn); + str_tolower (fn); snprintf (tmp, sizeof (tmp), "%%%ss", fmt); snprintf (dest, destlen, tmp, fn); break; @@ -343,7 +342,7 @@ NNTP_SERVER *mutt_select_newsserver (char *server) return NULL; } - buf = p = safe_calloc (mutt_strlen (server) + 10, sizeof (char)); + buf = p = safe_calloc (safe_strlen (server) + 10, sizeof (char)); if (url_check_scheme (server) == U_UNKNOWN) { strcpy (buf, "nntp://"); p = strchr (buf, '\0'); @@ -512,8 +511,8 @@ static void nntp_create_newsrc_line (NNTP_DATA * data, char **buf, line = *buf + (*pline - line); } strcpy (line, data->group); - len -= mutt_strlen (line) + 1; - line += mutt_strlen (line); + len -= safe_strlen (line) + 1; + line += safe_strlen (line); *line++ = data->subscribed ? ':' : '!'; *line++ = ' '; *line = '\0'; @@ -646,7 +645,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 += mutt_strlen (line); + line += safe_strlen (line); } /* newrc being fully rewritten */ if (news->newsrc && @@ -672,7 +671,7 @@ static FILE *mutt_mkname (char *s) return fp; nntp_cache_expand (buf, "cache-XXXXXX"); - pc = buf + mutt_strlen (buf) - 12; /* positioning to "cache-XXXXXX" */ + pc = buf + safe_strlen (buf) - 12; /* positioning to "cache-XXXXXX" */ if ((fd = mkstemp (buf)) == -1) return NULL; strcpy (s, pc); /* generated name */ @@ -879,7 +878,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) + mutt_strlen (group) + 1); + (NNTP_DATA *) safe_calloc (1, sizeof (NNTP_DATA) + safe_strlen (group) + 1); data->group = (char *) data + sizeof (NNTP_DATA); strcpy (data->group, group); data->nserv = news; @@ -972,7 +971,7 @@ void nntp_buffy (char *s) if (data && data->subscribed && data->unread) { if (Context && Context->magic == M_NNTP && - !mutt_strcmp (data->group, ((NNTP_DATA *) Context->data)->group)) { + !safe_strcmp (data->group, ((NNTP_DATA *) Context->data)->group)) { unsigned int i, unread = 0; for (i = 0; i < Context->msgcount; i++)