X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Frcvdist.c;h=deeccb8893a22e24ab1625636bcba0502ad021d1;hp=89bb1dc5747b37eec751b85c203c69bc89d6e547;hb=10eff860a28b96582526eb739fd0a55441669938;hpb=5ba9c2f13fedf1d8d6ed907ef1f505616290efaa diff --git a/uip/rcvdist.c b/uip/rcvdist.c index 89bb1dc..deeccb8 100644 --- a/uip/rcvdist.c +++ b/uip/rcvdist.c @@ -170,20 +170,16 @@ rcvdistout(FILE *inb, char *form, char *addrs) cp = new_fs(form ? form : rcvdistcomps, NULL); format_len = strlen(cp); ncomps = fmt_compile(cp, &fmt) + 1; - if (!(nxtbuf = compbuffers = - (char **) calloc((size_t) ncomps, sizeof(char *)))) { - adios(EX_OSERR, NULL, "unable to allocate component buffers"); - } - if (!(savecomp = used_buf = - (struct comp **) calloc((size_t) (ncomps + 1), - sizeof(struct comp *)))) { - adios(EX_OSERR, NULL, "unable to allocate component buffer stack"); - } + nxtbuf = compbuffers = + (char **) mh_xcalloc((size_t) ncomps, sizeof(char *)); + savecomp = used_buf = + (struct comp **) mh_xcalloc((size_t) (ncomps + 1), + sizeof(struct comp *)); savecomp += ncomps + 1; *--savecomp = 0; for (i = ncomps; i--;) { - *nxtbuf++ = mh_xmalloc(SBUFSIZ); + *nxtbuf++ = mh_xcalloc(SBUFSIZ, sizeof(char)); } nxtbuf = compbuffers; tmpbuf = *nxtbuf++; @@ -256,7 +252,7 @@ rcvdistout(FILE *inb, char *form, char *addrs) finished: ; i = format_len + char_read + 256; - scanl = mh_xmalloc((size_t) i + 2); + scanl = mh_xcalloc((size_t) i + 2, sizeof(char)); dat[0] = dat[1] = dat[2] = dat[4] = 0; dat[3] = OUTPUTLINELEN; fmt_scan(fmt, scanl, i, dat);