for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
snprintf (bp, buflen, "%s%s=\"%s\"", s,
- pm->pm_name, pm->pm_value);
+ pm->pm_name, get_param_value(pm));
len = strlen (bp);
bp += len;
buflen -= len;
/* print parsed parameters attached to content type */
fprintf (stderr, " parameters\n");
for (pm = ci->ci_first_pm; pm; pm = pm->pm_next)
- fprintf (stderr, " %s=\"%s\"\n", pm->pm_name, pm->pm_value);
+ fprintf (stderr, " %s=\"%s\"\n", pm->pm_name, get_param_value(pm));
/* print internal flags for type/subtype */
fprintf (stderr, " type 0x%x subtype 0x%x params 0x%x\n",
{
int result = 0;
CI ci = &ct->c_ctinfo;
- PM pm;
- char *boundary = "";
+ char *boundary = "", *cp;
- for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
- if (! strcasecmp ("boundary", pm->pm_name)) {
- boundary = pm->pm_value;
- break;
- }
+ if ((cp = get_param(ci->ci_first_pm, "boundary, '-', 0)))
+ boundary = cp;
}
/*
* "message/external", then we are done with the
* headers (since it has no body).
*/
- if (ct->c_ctexbody)
+ if (ct->c_ctexbody) {
+ if (boundary && *boundary != '\0')
+ free(boundary);
return OK;
+ }
/*
* Now output the content bodies.
CT p = part->mp_part;
fprintf (out, "\n--%s\n", boundary);
- if (output_content (p, out) == NOTOK)
+ if (output_content (p, out) == NOTOK) {
+ if (boundary && *boundary != '\0')
+ free(boundary);
return NOTOK;
+ }
}
fprintf (out, "\n--%s--\n", boundary);
break;
}
+ if (boundary && *boundary != '\0')
+ free(boundary);
+
return result;
}
writeExternalBody (CT ct, FILE *out)
{
char *cp;
- PM pm;
struct exbody *e = (struct exbody *) ct->c_ctparams;
putc ('\n', out);
for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
snprintf (bp, buflen, "%s%s=\"%s\"", s, pm->pm_name,
- pm->pm_value);
+ get_param_value(pm));
len = strlen (bp);
bp += len;
buflen -= len;
for (pm = ci->ci_first_pm; pm; pm = pm->pm_next) {
snprintf (bp, buflen, "%s%s=\"%s\"", s, pm->pm_name,
- pm->pm_value);
+ get_param_value(pm));
len = strlen (bp);
bp += len;
buflen -= len;