#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 *
len2 = strlen(s2);
}
- cp = mh_xmalloc(len1 + len2 + 1);
+ cp = mh_xcalloc(len1 + len2 + 1, sizeof(char));
/* Copy s1 and free it */
if (s1) {