1 /* See LICENSE file for copyright and license details. */
11 ecalloc(size_t nmemb
, size_t size
)
14 p
= calloc(nmemb
, size
);
15 FAIL_IF(p
== NULL
, "calloc");
20 erealloc(void *p
, size_t len
)
22 if ((p
= realloc(p
, len
)) == NULL
)
23 die("realloc: %s\n", strerror(errno
));
28 die(const char *fmt
, ...)
33 (void)vfprintf(stderr
, fmt
, ap
);
36 if (fmt
[0] != '\0' && fmt
[strlen(fmt
)-1] == ':') {
37 (void)fputc(' ', stderr
);
40 (void)fputc('\n', stderr
);