* 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.
* 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;
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;
}
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)
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);
}
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);
}