void *ptr;
if (size == 0)
- errorx(1, _("internal error, tried to emalloc(0)"));
+ errorx2(1, _("internal error, tried to emalloc(0)"));
if ((ptr = malloc(size)) == NULL)
- errorx(1, _("unable to allocate memory"));
+ errorx2(1, _("unable to allocate memory"));
return ptr;
}
void *ptr;
if (nmemb == 0 || size == 0)
- errorx(1, _("internal error, tried to emalloc2(0)"));
+ errorx2(1, _("internal error, tried to emalloc2(0)"));
if (nmemb > SIZE_MAX / size)
- errorx(1, _("internal error, emalloc2() overflow"));
+ errorx2(1, _("internal error, emalloc2() overflow"));
size *= nmemb;
if ((ptr = malloc(size)) == NULL)
- errorx(1, _("unable to allocate memory"));
+ errorx2(1, _("unable to allocate memory"));
return ptr;
}
{
if (size == 0)
- errorx(1, _("internal error, tried to erealloc(0)"));
+ errorx2(1, _("internal error, tried to erealloc(0)"));
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
- errorx(1, _("unable to allocate memory"));
+ errorx2(1, _("unable to allocate memory"));
return ptr;
}
{
if (nmemb == 0 || size == 0)
- errorx(1, _("internal error, tried to erealloc3(0)"));
+ errorx2(1, _("internal error, tried to erealloc3(0)"));
if (nmemb > SIZE_MAX / size)
- errorx(1, _("internal error, erealloc3() overflow"));
+ errorx2(1, _("internal error, erealloc3() overflow"));
size *= nmemb;
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
- errorx(1, _("unable to allocate memory"));
+ errorx2(1, _("unable to allocate memory"));
return ptr;
}
va_end(ap);
if (len == -1)
- errorx(1, _("unable to allocate memory"));
+ errorx2(1, _("unable to allocate memory"));
return len;
}
int len;
if ((len = vasprintf(ret, format, args)) == -1)
- errorx(1, _("unable to allocate memory"));
+ errorx2(1, _("unable to allocate memory"));
return len;
}