From 22348c0a46430f99f0e08a5bf3504315f28f0e70 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sat, 12 Nov 2016 18:48:20 +0000 Subject: [PATCH] Replace some add(FIELD, NULL) with mh_xstrdup(FIELD). The various FIELD are macros for string constants so can not be NULL. --- uip/mhbuildsbr.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index cf41bfb1..5a0001bf 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -377,7 +377,7 @@ finish_field: */ if (! dist) { - np = add (VRSN_FIELD, NULL); + np = mh_xstrdup(VRSN_FIELD); vp = concat (" ", VRSN_VALUE, "\n", NULL); add_header (ct, np, vp); } @@ -1679,7 +1679,7 @@ build_headers (CT ct, int header_encoding) /* * output the content type and subtype */ - np = add (TYPE_FIELD, NULL); + np = mh_xstrdup(TYPE_FIELD); vp = concat (" ", ci->ci_type, "/", ci->ci_subtype, NULL); /* keep track of length of line */ @@ -1728,7 +1728,7 @@ build_headers (CT ct, int header_encoding) * output the Content-ID, unless disabled by -nocontentid */ if (contentidsw && ct->c_id) { - np = add (ID_FIELD, NULL); + np = mh_xstrdup(ID_FIELD); vp = concat (" ", ct->c_id, NULL); add_header (ct, np, vp); } @@ -1736,7 +1736,7 @@ build_headers (CT ct, int header_encoding) * output the Content-Description */ if (ct->c_descr) { - np = add (DESCR_FIELD, NULL); + np = mh_xstrdup(DESCR_FIELD); vp = concat (" ", ct->c_descr, NULL); if (header_encoding != CE_8BIT) { if (encode_rfc2047(DESCR_FIELD, &vp, header_encoding, NULL)) { @@ -1751,7 +1751,7 @@ build_headers (CT ct, int header_encoding) * set, then we need to build it. */ if (ct->c_dispo) { - np = add (DISPO_FIELD, NULL); + np = mh_xstrdup(DISPO_FIELD); vp = concat (" ", ct->c_dispo, NULL); add_header (ct, np, vp); } else if (ct->c_dispo_type) { @@ -1777,7 +1777,7 @@ skip_headers: * output the Content-MD5 */ if (checksw) { - np = add (MD5_FIELD, NULL); + np = mh_xstrdup(MD5_FIELD); vp = calculate_digest (ct, (ct->c_encoding == CE_QUOTED) ? 1 : 0); add_header (ct, np, vp); } @@ -1796,7 +1796,7 @@ skip_headers: break; case CE_8BIT: - np = add (ENCODING_FIELD, NULL); + np = mh_xstrdup(ENCODING_FIELD); vp = concat (" ", "8bit", "\n", NULL); add_header (ct, np, vp); break; @@ -1805,7 +1805,7 @@ skip_headers: if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART) adios (NULL, "internal error, invalid encoding"); - np = add (ENCODING_FIELD, NULL); + np = mh_xstrdup(ENCODING_FIELD); vp = concat (" ", "quoted-printable", "\n", NULL); add_header (ct, np, vp); break; @@ -1814,7 +1814,7 @@ skip_headers: if (ct->c_type == CT_MESSAGE || ct->c_type == CT_MULTIPART) adios (NULL, "internal error, invalid encoding"); - np = add (ENCODING_FIELD, NULL); + np = mh_xstrdup(ENCODING_FIELD); vp = concat (" ", "base64", "\n", NULL); add_header (ct, np, vp); break; @@ -1823,7 +1823,7 @@ skip_headers: if (ct->c_type == CT_MESSAGE) adios (NULL, "internal error, invalid encoding"); - np = add (ENCODING_FIELD, NULL); + np = mh_xstrdup(ENCODING_FIELD); vp = concat (" ", "binary", "\n", NULL); add_header (ct, np, vp); break; -- 2.56.0