sacc

sacc (saccomys): simple gopher client.
Log | Files | Refs | LICENSE

commit e1eceee39ab489e5bc8ead2f8244b0cad3d1618f
parent 687f65e4cda6fdfe5eafd263bb30a091fe3443af
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Sun, 25 Feb 2018 15:53:29 +0100

use libc calloc() and show 'calloc:' on error

Diffstat:
sacc.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sacc.c b/sacc.c @@ -121,10 +121,10 @@ xmalloc(const size_t n) static void * xcalloc(size_t n) { - char *m = xmalloc(n); + char *m = calloc(1, n); - while (n) - m[--n] = 0; + if (!m) + die("calloc: %s", strerror(errno)); return m; }