X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhlsbr.c;h=31c24bb11bdd58588480cb58fd8615253d7753f4;hp=68d083539b109c0295d2ff751500e20c846f087b;hb=d2da15ecabb03fb2de72863abdf5f21e52fdf329;hpb=9dc2494d155597ca15d9d05853d5bcad73701c00 diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 68d0835..31c24bb 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -3,13 +3,18 @@ * 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 #include #include #include -#include +#include +#include #include #include @@ -72,7 +77,7 @@ static struct swit mhlswitches[] = { #define VERSIONSW 15 { "version", 0 }, #define HELPSW 16 - { "help", 4 }, + { "help", 0 }, #define FORW1SW 17 { "forward", -7 }, /* interface from forw */ #define FORW2SW 18 @@ -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; }