X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fforw.c;h=93870b1af0c5c91e9cf1bc9738adb7536de5ccf4;hb=b439ec143c4d2e2daf4b0a9c332123f24500cd9a;hp=e842d2692f4a6da0c7331196b3a26cfc060a625c;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/uip/forw.c b/uip/forw.c index e842d26..93870b1 100644 --- a/uip/forw.c +++ b/uip/forw.c @@ -13,6 +13,7 @@ #include #include #include +#include #define IFORMAT "digest-issue-%s" @@ -392,16 +393,8 @@ try_it_again: if (!form) form = digestcomps; in = build_form (form, digest, volume, issue); - } else { - if (form) { - if ((in = open (etcpath (form), O_RDONLY)) == NOTOK) - adios (form, "unable to open form file"); - } else { - if ((in = open (etcpath (forwcomps), O_RDONLY)) == NOTOK) - adios (forwcomps, "unable to open default components file"); - form = forwcomps; - } - } + } else + in = open_form(&form, forwcomps); if ((out = creat (drft, m_gmprot ())) == NOTOK) adios (drft, "unable to create"); @@ -688,8 +681,7 @@ build_form (char *form, char *digest, int volume, int issue) if ((in = dup (fileno (tmp))) == NOTOK) adios ("dup", "unable to"); - if ((line = malloc ((unsigned) fmtsize)) == NULL) - adios (NULL, "unable to allocate format line storage"); + line = mh_xmalloc ((unsigned) fmtsize); fmt_scan (fmt, line, fmtsize, dat); fputs (line, tmp); free (line);