#include <h/tws.h>
#include <h/mime.h>
#include <h/mhparse.h>
+#include <h/utils.h>
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
extern int ebcdicsw;
extern int listsw;
extern int rfc934sw;
+extern int contentidsw;
extern int endian; /* mhmisc.c */
HF hp;
/* allocate header field structure */
- if (!(hp = malloc (sizeof(*hp))))
- adios (NULL, "out of memory");
+ hp = mh_xmalloc (sizeof(*hp));
/* link data into header structure */
hp->name = name;
goto no_body;
}
- if ((e->eb_body = bp = malloc ((unsigned) size)) == NULL)
- adios (NULL, "out of memory");
+ e->eb_body = bp = mh_xmalloc ((unsigned) size);
fseek (p->c_fp, p->c_begin, SEEK_SET);
while (size > 0)
switch (cc = fread (bp, sizeof(*bp), size, p->c_fp)) {
add_header (ct, np, vp);
/*
- * output the Content-ID
+ * output the Content-ID, unless disabled by -nocontentid
*/
- if (ct->c_id) {
+ if (contentidsw && ct->c_id) {
np = add (ID_FIELD, NULL);
vp = concat (" ", ct->c_id, NULL);
add_header (ct, np, vp);