X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Futils.c;h=f964e7e31d65e7a344909e25e519ad2a51515330;hp=fa4cfdb2b3b8e5e97831407f5599327b05fa43e5;hb=10eff860a28b96582526eb739fd0a55441669938;hpb=d6742b1bb19c7eca8488402484a6e4f55543d789 diff --git a/sbr/utils.c b/sbr/utils.c index fa4cfdb..f964e7e 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -22,26 +22,6 @@ #define MAXMSGS 256 /* -** Safely call malloc -*/ -void * -mh_xmalloc(size_t size) -{ - void *memory; - - if (size == 0) { - adios(EX_SOFTWARE, NULL, "Tried to malloc 0 bytes"); - } - - memory = malloc(size); - if (!memory) { - adios(EX_OSERR, NULL, "Malloc failed"); - } - - return memory; -} - -/* ** Safely call realloc */ void * @@ -134,7 +114,7 @@ add(char *s2, char *s1) len2 = strlen(s2); } - cp = mh_xmalloc(len1 + len2 + 1); + cp = mh_xcalloc(len1 + len2 + 1, sizeof(char)); /* Copy s1 and free it */ if (s1) {