X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/6c42153ad9362cc676ea66563bf400d7511b3b68..4eaed47f91c9de0b520ea41188be3fedae4b99ca:/sbr/fmt_new.c?ds=sidebyside diff --git a/sbr/fmt_new.c b/sbr/fmt_new.c index effd06f1..c1bc7c73 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");