···8484# define MAX(a,b) ((a) < (b) ? (b) : (a))
8585# define MIN(a,b) ((a) < (b) ? (a) : (b))
86868787+/* Use this with care. If the compiler can't see the array
8888+ * definition, it obviously won't produce a correct result. */
8989+#define mutt_array_size(x) (sizeof (x) / sizeof ((x)[0]))
9090+8791/* For mutt_format_string() justifications */
8892/* Making left 0 and center -1 is of course completely nonsensical, but
8993 * it retains compatibility for any patches that call mutt_format_string.
+3-3
mutt_ssl.c
···10171017 int done, row, i;
10181018 FILE *fp;
1019101910201020- menu->max = 23;
10201020+ menu->max = mutt_array_size (part) * 2 + 9;
10211021 menu->dialog = (char **) safe_calloc (1, menu->max * sizeof (char *));
10221022 for (i = 0; i < menu->max; i++)
10231023 menu->dialog[i] = (char *) safe_calloc (1, SHORT_STRING * sizeof (char));
···10261026 strfcpy (menu->dialog[row], _("This certificate belongs to:"), SHORT_STRING);
10271027 row++;
10281028 x509_subject = X509_get_subject_name (cert);
10291029- for (i = 0; i < 7; i++)
10291029+ for (i = 0; i < mutt_array_size (part); i++)
10301030 snprintf (menu->dialog[row++], SHORT_STRING, " %s",
10311031 x509_get_part (x509_subject, part[i]));
10321032···10341034 strfcpy (menu->dialog[row], _("This certificate was issued by:"), SHORT_STRING);
10351035 row++;
10361036 x509_issuer = X509_get_issuer_name (cert);
10371037- for (i = 0; i < 7; i++)
10371037+ for (i = 0; i < mutt_array_size (part); i++)
10381038 snprintf (menu->dialog[row++], SHORT_STRING, " %s",
10391039 x509_get_part (x509_issuer, part[i]));
10401040