the ‘kids don't do this at home’ commit.
[apps/madmutt.git] / nntp / newsrc.c
index 349e3e7..d80b21d 100644 (file)
@@ -237,12 +237,14 @@ static int nntp_parse_cacheindex (NNTP_SERVER * news)
   return 0;
 }
 
-const char *nntp_format_str (char *dest, ssize_t destlen, char op,
-                             const char *src, const char *fmt,
-                             const char *ifstring, const char *elsestring,
-                             unsigned long data, format_flag flags)
+const char *nntp_format_str(char *dest, ssize_t destlen, char op,
+                            const char *src, const char *fmt,
+                            const char *ifstr __attribute__((unused)),
+                            const char *elstr __attribute__((unused)),
+                            anytype data __attribute__((unused)),
+                            format_flag flags __attribute__((unused)))
 {
-  char fn[SHORT_STRING], tmp[SHORT_STRING];
+  char fn[STRING], tmp[STRING];
 
   switch (op) {
   case 's':
@@ -344,8 +346,7 @@ NNTP_SERVER *mutt_select_newsserver (char *server)
   if (!conn)
     return NULL;
 
-  mutt_FormatString (file, sizeof (file), NONULL (NewsRc), nntp_format_str, 0,
-                     0);
+  m_strformat(file, sizeof(file), NONULL(NewsRc), nntp_format_str, NULL, 0);
   mutt_expand_path (file, sizeof (file));
 
   serv = (NNTP_SERVER *) conn->data;
@@ -511,15 +512,6 @@ static void nntp_create_newsrc_line (NNTP_DATA * data, char **buf,
       len--;
     }
 
-#if 0
-    if (data->entries[x].first == data->entries[x].last)
-      snprintf (line, len, "%d%n", data->entries[x].first, &i);
-    else
-      snprintf (line, len, "%d-%d%n",
-                data->entries[x].first, data->entries[x].last, &i);
-    len -= i;
-    line += i;
-#else
     i = puti (line, data->entries[x].first);
     line += i;
     len -= i;
@@ -530,7 +522,6 @@ static void nntp_create_newsrc_line (NNTP_DATA * data, char **buf,
       line += i;
       len -= i;
     }
-#endif
   }
   *line++ = '\n';
   *line = '\0';
@@ -906,7 +897,7 @@ int nntp_save_cache_group (CONTEXT * ctx)
     if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->article_num != prev) {
       h = ctx->hdrs[i];
       addr[0] = 0;
-      rfc822_write_address (addr, sizeof (addr), h->env->from, 0);
+      rfc822_addrcat(addr, sizeof(addr), h->env->from, 0);
       tm = gmtime (&h->date_sent);
       snprintf (buf, sizeof (buf),
                 "%d\t%s\t%s\t%d %s %d %02d:%02d:%02d GMT\t%s\t",