diff options
Diffstat (limited to 'envreallocn.c')
-rw-r--r-- | envreallocn.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/envreallocn.c b/envreallocn.c new file mode 100644 index 0000000..25a5e33 --- /dev/null +++ b/envreallocn.c @@ -0,0 +1,17 @@ +/* See LICENSE file for copyright and license details. */ +#include "libsimple.h" + + +extern char *argv0; + + +void * +libsimple_envreallocn(int status, void *ptr, size_t n, va_list ap) +{ + void *ret = libsimple_vreallocn(ptr, n, ap); + if (!ret) { + fprintf(stderr, "%s: realloc: %s\n", argv0, strerror(errno)); + exit(status); + } + return ret; +} |