X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fscansbr.c;h=3bede5ae792a54b3b75e0a9bfa9491c692d73349;hp=c04e8c707c03c6a6ada5a78412ef1223543ab397;hb=389877bae1fe1a9f7259b8979f6a930744d90fab;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68 diff --git a/uip/scansbr.c b/uip/scansbr.c index c04e8c7..3bede5a 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -14,6 +14,7 @@ #include #include #include +#include #ifdef _FSTDIO # define _ptr _p /* Gag */ @@ -96,8 +97,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, 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()); @@ -133,8 +133,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg, 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); } /* @@ -331,9 +330,9 @@ finished: 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; } } }