X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fvfgets.c;h=beb0afd0a43853249c588c0250951e67eb87b65b;hb=81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2;hp=52a8e74d0ed62cbe301fa25cc60b3ce29807089b;hpb=1691e80890e5d8ba258c51c214a3e91880e1db2b;p=mmh diff --git a/sbr/vfgets.c b/sbr/vfgets.c index 52a8e74..beb0afd 100644 --- a/sbr/vfgets.c +++ b/sbr/vfgets.c @@ -3,9 +3,14 @@ * vfgets.c -- virtual fgets * * $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 #define QUOTE '\\' @@ -19,8 +24,7 @@ vfgets (FILE *in, char **bp) static char *pp = NULL; if (pp == NULL) - if (!(pp = malloc ((size_t) (len = BUFSIZ)))) - adios (NULL, "unable to allocate string storage"); + pp = mh_xmalloc ((size_t) (len = BUFSIZ)); for (ep = (cp = pp) + len - 1;;) { if (fgets (cp, ep - cp + 1, in) == NULL) {