]> granicus.if.org Git - neomutt/commitdiff
make_from
authorRichard Russon <rich@flatcap.org>
Sat, 23 Jun 2018 00:29:33 +0000 (01:29 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 23 Jun 2018 15:24:59 +0000 (16:24 +0100)
hdrline.c

index 10aeff5f6b8a66e6789f1a0cb1e44b2f6e6845ee..1c098eadcaa174c0719cd8c1d0e4b9d59809a5ed 100644 (file)
--- a/hdrline.c
+++ b/hdrline.c
@@ -245,7 +245,7 @@ static const char *make_from_prefix(enum FieldType disp)
  * make_from - Generate a From: field (with optional prefix)
  * @param env      Envelope of the email
  * @param buf      Buffer to store the result
- * @param len      Size of the buffer
+ * @param buflen   Size of the buffer
  * @param do_lists Should we check for mailing lists?
  *
  * Generate the %F or %L field in $index_format.
@@ -254,7 +254,7 @@ static const char *make_from_prefix(enum FieldType disp)
  * The field can optionally be prefixed by a character from $from_chars.
  * If $from_chars is not set, the prefix will be, "To", "Cc", etc
  */
-static void make_from(struct Envelope *env, char *buf, size_t len, int do_lists)
+static void make_from(struct Envelope *env, char *buf, size_t buflen, bool do_lists)
 {
   if (!env || !buf)
     return;
@@ -267,9 +267,9 @@ static void make_from(struct Envelope *env, char *buf, size_t len, int do_lists)
 
   if (do_lists || me)
   {
-    if (check_for_mailing_list(env->to, make_from_prefix(DISP_TO), buf, len))
+    if (check_for_mailing_list(env->to, make_from_prefix(DISP_TO), buf, buflen))
       return;
-    if (check_for_mailing_list(env->cc, make_from_prefix(DISP_CC), buf, len))
+    if (check_for_mailing_list(env->cc, make_from_prefix(DISP_CC), buf, buflen))
       return;
   }
 
@@ -299,7 +299,7 @@ static void make_from(struct Envelope *env, char *buf, size_t len, int do_lists)
     return;
   }
 
-  snprintf(buf, len, "%s%s", make_from_prefix(disp), mutt_get_name(name));
+  snprintf(buf, buflen, "%s%s", make_from_prefix(disp), mutt_get_name(name));
 }
 
 static void make_from_addr(struct Envelope *hdr, char *buf, size_t len, int do_lists)
@@ -805,7 +805,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
       if (!optional)
       {
         colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR);
-        make_from(hdr->env, tmp, sizeof(tmp), 0);
+        make_from(hdr->env, tmp, sizeof(tmp), false);
         mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
         add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
       }
@@ -935,7 +935,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co
       if (!optional)
       {
         colorlen = add_index_color(buf, buflen, flags, MT_COLOR_INDEX_AUTHOR);
-        make_from(hdr->env, tmp, sizeof(tmp), 1);
+        make_from(hdr->env, tmp, sizeof(tmp), true);
         mutt_format_s(buf + colorlen, buflen - colorlen, prec, tmp);
         add_index_color(buf + colorlen, buflen - colorlen, flags, MT_COLOR_INDEX);
       }