#include <h/mh.h>
#include <fcntl.h>
+#include <h/utils.h>
#include <h/md5.h>
#include <h/mts.h>
#include <h/tws.h>
* headers (since it has no body).
*/
if (ct->c_ctexbody) {
- if (boundary && *boundary != '\0')
+ if (*boundary != '\0')
free(boundary);
return OK;
}
m = (struct multipart *) ct->c_ctparams;
if (m->mp_content_before) {
- fprintf (out, "%s", m->mp_content_before);
+ fputs(m->mp_content_before, out);
}
for (part = m->mp_parts; part; part = part->mp_next) {
fprintf (out, "\n--%s\n", boundary);
if (output_content (p, out) == NOTOK) {
- if (boundary && *boundary != '\0')
+ if (*boundary != '\0')
free(boundary);
return NOTOK;
}
fprintf (out, "\n--%s--\n", boundary);
if (m->mp_content_after) {
- fprintf (out, "%s", m->mp_content_after);
+ fputs(m->mp_content_after, out);
}
}
break;
break;
}
- if (boundary && *boundary != '\0')
+ if (*boundary != '\0')
free(boundary);
return result;
* doesn't falsely match an mbox delimiter.
*/
cp = bufp;
- if (gotlen >= 5 && strncmp (cp, "From ", 5) == 0) {
+ if (gotlen >= 5 && HasPrefix(cp, "From ")) {
fprintf (out, "=%02X", 'F');
cp++;
n += 3;