X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;ds=sidebyside;f=uip%2Fmhlsbr.c;h=af3fa554df5ba3fdada202ef1ea70fbd7163240d;hb=81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2;hp=d707ed15d15d2e81d52649d71fdfe880456f7e45;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68;p=mmh diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index d707ed1..af3fa55 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -480,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 (); @@ -950,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); @@ -1645,8 +1650,7 @@ doface (struct mcomp *c1) 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; }