* man/mhbuild.man: wrapped one appearance of "Content-Disposition"
[mmh] / sbr / brkstring.c
index 715aaf5..d2f71aa 100644 (file)
@@ -4,9 +4,14 @@
  *             -- an array of substrings
  *
  * $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 <h/mh.h>
+#include <h/utils.h>
 
 /* allocate this number of pointers at a time */
 #define NUMBROKEN 256
@@ -29,8 +34,7 @@ brkstring (char *str, char *brksep, char *brkterm)
     /* allocate initial space for pointers on first call */
     if (!broken) {
        len = NUMBROKEN;
-       if (!(broken = (char **) malloc ((size_t) (len * sizeof(*broken)))))
-           adios (NULL, "unable to malloc array in brkstring");
+       broken = (char **) mh_xmalloc ((size_t) (len * sizeof(*broken)));
     }
 
     /*
@@ -44,8 +48,7 @@ brkstring (char *str, char *brksep, char *brkterm)
        /* enlarge pointer array, if necessary */
        if (i >= len) {
            len += NUMBROKEN;
-           if (!(broken = realloc (broken, (size_t) (len * sizeof(*broken)))))
-               adios (NULL, "unable to realloc array in brkstring");
+           broken = mh_xrealloc (broken, (size_t) (len * sizeof(*broken)));
        }
 
        while (brkany (c = *s, brksep))