From 34c0fd8f36269699b75e0aaf841911b5ae06246e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 28 Aug 2018 13:23:45 +0200 Subject: Simplify en* functions, and handle argv0 == NULL correct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- envmalloczn.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'envmalloczn.c') diff --git a/envmalloczn.c b/envmalloczn.c index 832ce67..84c0ea7 100644 --- a/envmalloczn.c +++ b/envmalloczn.c @@ -3,17 +3,12 @@ #ifndef TEST -extern char *argv0; - - void * libsimple_envmalloczn(int status, int clear, size_t n, va_list ap) /* TODO test */ { void *ret = libsimple_vmalloczn(clear, n, ap); - if (!ret) { - fprintf(stderr, "%s: %s: %s\n", argv0, clear ? "calloc" : "malloc", strerror(errno)); - exit(status); - } + if (!ret) + enprintf(status, "%s:", clear ? "calloc" : "malloc"); return ret; } -- cgit v1.2.3-70-g09d2