X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhlsbr.c;h=31c24bb11bdd58588480cb58fd8615253d7753f4;hp=f22303b8b51e680998792cf9ba056730d1d3b794;hb=389877bae1fe1a9f7259b8979f6a930744d90fab;hpb=7879ea4084333b448c5a3a49c1cb52023e3808d1 diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index f22303b..31c24bb 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -3,6 +3,10 @@ * mhlsbr.c -- main routines for nmh message lister * * $Id$ + * + * This code is Copyright (c) 2002, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ #include @@ -10,6 +14,7 @@ #include #include #include +#include #include #include @@ -476,6 +481,11 @@ mhl (int argc, char **argv) vecp > 1 ? "s" : ""); } + fflush(stdout); + if(ferror(stdout)){ + adios("output", "error writing"); + } + if (clearflg > 0 && ontty == NOTTY) clear_screen (); @@ -946,8 +956,7 @@ mhlfile (FILE *fp, char *mname, int ofilen, int ofilec) continue; } if (dobody && !strcasecmp (c1->c_name, "body")) { - if ((holder.c_text = malloc (sizeof(buf))) == NULL) - adios (NULL, "unable to allocate buffer memory"); + holder.c_text = mh_xmalloc (sizeof(buf)); strncpy (holder.c_text, buf, sizeof(buf)); while (state == BODY) { putcomp (c1, &holder, BODYCOMP); @@ -1635,14 +1644,12 @@ doface (struct mcomp *c1) if (cp) { int j; char *dp; - if ((dp = realloc (cp, (unsigned) (j = len + i))) == NULL) - adios (NULL, "unable to allocate face storage"); + dp = mh_xrealloc (cp, (unsigned) (j = len + i)); memcpy(dp + len, buffer, i); cp = dp, len = j; } else { - if ((cp = malloc ((unsigned) i)) == NULL) - adios (NULL, "unable to allocate face storage"); + cp = mh_xmalloc ((unsigned) i); memcpy(cp, buffer, i); len = i; }