if (copy_input_to_output (file, infp, outfile, outfp) != OK) {
inform("unable to copy message to %s, "
- "it might be lost\n", outfile);
+ "it might be lost", outfile);
}
fclose (infp);
if (copy_input_to_output (input_filename, infp,
outfile, outfp) != OK) {
inform("unable to copy message to %s, "
- "it might be lost\n", outfile);
+ "it might be lost", outfile);
}
fclose (infp);
(void) m_backup (file);
}
}
+ if (outfp) {
+ /* close fp opened by the m_mktemp2() call in mhfixmsgsbr() */
+ fclose (outfp);
+ outfp = NULL;
+ }
}
} else {
status = 1;
}
outfile = mh_xstrdup (tempfile);
} else {
- die("missing both input and output filenames\n");
+ die("missing both input and output filenames");
}
} /* else *outfp was defined by caller */
to the output. */
if (copy_input_to_output (input_filename, *infp, outfile,
*outfp) != OK) {
- inform("unable to copy message to %s, it might be lost\n",
+ inform("unable to copy message to %s, it might be lost",
outfile);
}
}
}
break;
}
- inform("did not find %s in %s", type, hf->value);
+ char *hf_value = cpytrim (hf->value);
+ inform("did not find %s in %s", type, hf_value);
+ free (hf_value);
}
}
}
remove_parameter (hf->value, "type");
break;
}
+ char *hf_value = cpytrim (hf->value);
inform("did not find multipart/"
- "related in header %s", hf->value);
+ "related in header %s", hf_value);
+ free (hf_value);
}
}
} else {
/* This m_mktemp2() call closes the temp file. */
if ((tempfile = m_mktemp2 (NULL, invo_name, NULL, NULL)) == NULL) {
- inform("unable to create temporary file in %s",
- get_temp_dir());
+ inform("unable to create temporary file in %s", get_temp_dir());
} else {
tmp_plain_file = mh_xstrdup (tempfile);
if (reformat_part (tp_part, tmp_plain_file,
switch (ct->c_type) {
case CT_TEXT:
if (ct->c_subtype == TEXT_PLAIN) {
+ char *const ct_charset = content_charset (ct);
+
status = convert_charset (ct, dest_charset, message_mods);
if (status == OK) {
if (verbosw) {
- char *ct_charset = content_charset (ct);
-
report (NULL, ct->c_partno, ct->c_file,
"convert %s to %s", ct_charset, dest_charset);
- free (ct_charset);
}
} else {
- char *ct_charset = content_charset (ct);
-
report ("iconv", ct->c_partno, ct->c_file,
"failed to convert %s to %s", ct_charset, dest_charset);
- free (ct_charset);
}
+ free (ct_charset);
}
break;
++*message_mods;
}
} else {
- inform("failed to decode %s parameter %s", hf->name, hf->value);
+ char *hf_value = cpytrim (hf->value);
+ inform("failed to decode %s parameter %s", hf->name, hf_value);
+ free (hf_value);
status = NOTOK;
}
}
replace_substring (&hf->value, semicolon_loc, new_params);
free((void *)new_params); /* Cast away const. Sigh. */
free((void *)params);
- } else {
- inform("did not find semicolon in %s:%s\n",
- hf->name, hf->value);
}
}
}