add sbase-style ecalloc(), calloc: or die
... remove intermediary variables
This commit is contained in:
parent
164986763a
commit
5a20b409c6
3 changed files with 18 additions and 12 deletions
10
util.c
10
util.c
|
|
@ -6,6 +6,16 @@
|
|||
|
||||
#include "util.h"
|
||||
|
||||
void *
|
||||
ecalloc(size_t nmemb, size_t size)
|
||||
{
|
||||
void *p;
|
||||
|
||||
if (!(p = calloc(nmemb, size)))
|
||||
perror(NULL);
|
||||
return p;
|
||||
}
|
||||
|
||||
void
|
||||
die(const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
|
|
|||
Loading…
Reference in a new issue