X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fmhbuildsbr.c;h=64ec8a6800b66b07608a8ec8a2e4f4df8f8ff803;hb=59a210325d70e6a38c0ef9e5dcb105cec8bd38d2;hp=a65736f3c7e234adc22f0cd12658038d2add420b;hpb=794dab6aa5027ffaf024506140c258f6a0a9322d;p=mmh diff --git a/uip/mhbuildsbr.c b/uip/mhbuildsbr.c index a65736f..64ec8a6 100644 --- a/uip/mhbuildsbr.c +++ b/uip/mhbuildsbr.c @@ -3,6 +3,10 @@ * mhbuildsbr.c -- routines to expand/translate MIME composition files * * $Id$ + * + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ /* @@ -19,18 +23,28 @@ #include #include #include -#include -#include +#include +#include #include #include +#include + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef TM_IN_SYS_TIME +# include +# else +# include +# endif +#endif #ifdef HAVE_SYS_WAIT_H # include #endif -extern int errno; - extern int debugsw; extern int verbosw; @@ -772,8 +786,7 @@ add_header (CT ct, char *name, char *value) 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; @@ -1540,8 +1553,7 @@ invalid_param: 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)) {