X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Ffmt_new.c;h=c1bc7c730e83edfccf4462ba2094ea50d3af89fb;hp=effd06f1ae98323a93f3c81b97a64ef256897088;hb=81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2;hpb=582d618b69077087961c367bd1631495906c92a8 diff --git a/sbr/fmt_new.c b/sbr/fmt_new.c index effd06f..c1bc7c7 100644 --- a/sbr/fmt_new.c +++ b/sbr/fmt_new.c @@ -10,6 +10,7 @@ */ #include +#include #define QUOTE '\\' @@ -41,8 +42,7 @@ new_fs (char *form, char *format, char *default_fs) if (fstat (fileno (fp), &st) == -1) adios (form, "unable to stat format file"); - if (!(formats = malloc ((size_t) st.st_size + 1))) - adios (form, "unable to allocate space for format"); + formats = mh_xmalloc ((size_t) st.st_size + 1); if (read (fileno(fp), formats, (int) st.st_size) != st.st_size) adios (form, "error reading format file");