X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffmt_new.c;h=c3b1ea27f63beee73cf0aed19e8105e15f430069;hp=9a7988ebb07993aa2c3a1a027dcfca4adf49a12f;hb=10eff860a28b96582526eb739fd0a55441669938;hpb=d6742b1bb19c7eca8488402484a6e4f55543d789 diff --git a/sbr/fmt_new.c b/sbr/fmt_new.c index 9a7988e..c3b1ea2 100644 --- a/sbr/fmt_new.c +++ b/sbr/fmt_new.c @@ -43,7 +43,7 @@ new_fs(char *form, char *def_form) if (fstat(fileno(fp), &st) == -1) { adios(EX_IOERR, form, "unable to stat format file"); } - formats = mh_xmalloc((size_t) st.st_size + 1); + formats = mh_xcalloc((size_t) st.st_size + 1, sizeof(char)); if (read(fileno(fp), formats, (int)st.st_size) != st.st_size) { adios(EX_IOERR, form, "error reading format file"); } @@ -60,7 +60,7 @@ new_fs(char *form, char *def_form) if (fstat(fileno(fp), &st) == -1) { adios(EX_IOERR, def_form, "unable to stat format file"); } - formats = mh_xmalloc((size_t) st.st_size + 1); + formats = mh_xcalloc((size_t) st.st_size + 1, sizeof(char)); if (read(fileno(fp), formats, (int)st.st_size) != st.st_size) { adios(EX_IOERR, def_form, "error reading format file"); }