fclose(in);
free (ct);
return NULL;
- } else {
- adios (NULL, "draft shouldn't contain %s: field", name);
}
+ adios (NULL, "draft shouldn't contain %s: field", name);
}
/* ignore any Content-Type fields in the header */
if ((cp = strchr(prefix, 'a')) == NULL)
adios (NULL, "internal error(4)");
+ /*
+ * If using EAI, force 8-bit charset.
+ */
+ if (header_encoding == CE_8BIT) {
+ set_charset (ct, 1);
+ }
+
/*
* Scan the contents. Choose a transfer encoding, and
* check if prefix for multipart boundary clashes with
strncpy (content, buf + 2, sizeof(content));
inlineD = 1;
goto rock_and_roll;
- } else {
- inlineD = 0;
}
+ inlineD = 0;
/* the directive is implicit */
strncpy (content, "text/plain", sizeof(content));
np = output_params(len, ct->c_dispo_first, NULL, 0);
vp = add(np, vp);
vp = add("\n", vp);
- if (np)
- free(np);
+ mh_xfree(np);
add_header (ct, mh_xstrdup(DISPO_FIELD), vp);
}
/*
* output the Content-Transfer-Encoding
+ * If using EAI and message body is 7-bit, force 8-bit C-T-E.
*/
+ if (header_encoding == CE_8BIT && ct->c_encoding == CE_7BIT) {
+ ct->c_encoding = CE_8BIT;
+ }
+
switch (ct->c_encoding) {
case CE_7BIT:
/* Nothing to output */
for (pm = ct->c_ctinfo.ci_first_pm; pm; pm = pm->pm_next) {
if (strcasecmp(pm->pm_name, "name") == 0) {
- if (pm->pm_value)
- free(pm->pm_value);
+ mh_xfree(pm->pm_value);
pm->pm_value = mh_xstrdup(simplename);
break;
}
free (reply_file);
admonish (NULL, "failed to read %s", reply_file);
return;
- } else {
- (void) close (fd);
- }
+ }
+ (void) close (fd);
}
/* This sets reply_ct->c_ctparams, and reply_ct->c_termproc if the