#include <h/fmt_scan.h>
#include <h/scansbr.h>
#include <h/tws.h>
+#include <h/utils.h>
#ifdef _FSTDIO
# define _ptr _p /* Gag */
width = MAXSCANL;
}
dat[3] = slwidth = width;
- if ((scanl = (char *) malloc((size_t) (slwidth + 2) )) == NULL)
- adios (NULL, "unable to malloc scan line (%d bytes)", slwidth+2);
+ scanl = (char *) mh_xmalloc((size_t) MB_CUR_MAX * (slwidth + 2) );
if (outnum)
umask(~m_gmprot());
used_buf += ncomps+1; *--used_buf = 0;
rlwidth = bodycomp && (width > SBUFSIZ) ? width : SBUFSIZ;
for (i = ncomps; i--; )
- if ((*nxtbuf++ = malloc(rlwidth)) == NULL)
- adios (NULL, "unable to allocate component buffer");
+ *nxtbuf++ = mh_xmalloc(rlwidth);
}
/*
*/
if ((cptr = wantcomp[CHASH(name)])) {
do {
- if (!strcasecmp(name, cptr->c_name)) {
+ if (!mh_strcasecmp(name, cptr->c_name)) {
if (! cptr->c_text) {
cptr->c_text = tmpbuf;
for (cp = tmpbuf + strlen (tmpbuf) - 1;
if (datecomp->c_tws == NULL)
adios (NULL, "unable to allocate tws buffer");
*datecomp->c_tws = *dlocaltime ((time_t *) &st.st_mtime);
- datecomp->c_flags = -1;
+ datecomp->c_flags |= CF_DATEFAB|CF_TRUE;
} else {
- datecomp->c_flags = 0;
+ datecomp->c_flags &= ~CF_DATEFAB;
}
}
}