Replace mh_xmalloc() with mh_xcalloc()
[mmh] / sbr / brkstring.c
index 32dd37f..acbba6a 100644 (file)
@@ -7,6 +7,7 @@
 ** complete copyright information.
 */
 
+#include <sysexits.h>
 #include <h/mh.h>
 #include <h/utils.h>
 
@@ -29,7 +30,7 @@ brkstring(char *str, char *brksep, char *brkterm)
        /* allocate initial space for pointers on first call */
        if (!broken) {
                len = NUMBROKEN;
-               broken = (char **)mh_xmalloc((size_t)(len * sizeof(*broken)));
+               broken = (char **)mh_xcalloc((size_t)len, sizeof(*broken));
        }
 
        /*
@@ -71,5 +72,5 @@ brkstring(char *str, char *brksep, char *brkterm)
                        }
                }
        }
-       adios("brkstring()", "reached unreachable point");
+       adios(EX_SOFTWARE, "brkstring()", "reached unreachable point");
 }