X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fscansbr.c;h=ed163f3ee48ceb7c18a7e81d319095ee1d720627;hp=d985a5cab544ddf045450a24640cf3018ef78b63;hb=10eff860a28b96582526eb739fd0a55441669938;hpb=d6742b1bb19c7eca8488402484a6e4f55543d789 diff --git a/uip/scansbr.c b/uip/scansbr.c index d985a5c..ed163f3 100644 --- a/uip/scansbr.c +++ b/uip/scansbr.c @@ -88,8 +88,8 @@ scan(FILE *inb, int innum, int outnum, char *fmtstr, int width, int curflg, width = MAXSCANL; } dat[3] = slwidth = width; - scanl = (char *) mh_xmalloc((size_t) SCAN_CHARWIDTH * - (slwidth + 2)); /* probably for \n and \0 */ + scanl = (char *) mh_xcalloc((size_t)(slwidth + 2), + SCAN_CHARWIDTH); /* probably for \n and \0 */ /* Compile format string */ ncomps = fmt_compile(fmtstr, &fmt) + 1; FINDCOMP(datecomp, "date"); @@ -107,7 +107,7 @@ scan(FILE *inb, int innum, int outnum, char *fmtstr, int width, int curflg, *used_buf = NULL; /* allocate space for the items */ for (i = ncomps; i--; ) - *nxtbuf++ = mh_xmalloc(SBUFSIZ); + *nxtbuf++ = mh_xcalloc(SBUFSIZ, sizeof(char)); } /*