/* static */
static void
-bad_malloc(unsigned int size)
+badmalloc(unsigned int size)
{
eprint("fatal: could not malloc() %u bytes\n", size);
}
void *res = calloc(1, size);
if(!res)
- bad_malloc(size);
+ badmalloc(size);
return res;
}
exit(EXIT_FAILURE);
}
+void *
+erealloc(void *ptr, unsigned int size)
+{
+ void *res = realloc(ptr, size);
+ if(!res)
+ badmalloc(size);
+ return res;
+}
+
void
spawn(Arg *arg)
{