#include "alloc.h"
#include "error.h"
+#define DEFAULT_TEXT_DOMAIN "sudo"
+#include "gettext.h"
+
/*
* If there is no SIZE_MAX or SIZE_T_MAX we have to assume that size_t
* could be signed (as it is on SunOS 4.x). This just means that
void *ptr;
if (size == 0)
- errorx(1, "internal error, tried to emalloc(0)");
+ errorx(1, _("internal error, tried to emalloc(0)"));
if ((ptr = malloc(size)) == NULL)
- errorx(1, "unable to allocate memory");
+ errorx(1, _("unable to allocate memory"));
return ptr;
}
void *ptr;
if (nmemb == 0 || size == 0)
- errorx(1, "internal error, tried to emalloc2(0)");
+ errorx(1, _("internal error, tried to emalloc2(0)"));
if (nmemb > SIZE_MAX / size)
- errorx(1, "internal error, emalloc2() overflow");
+ errorx(1, _("internal error, emalloc2() overflow"));
size *= nmemb;
if ((ptr = malloc(size)) == NULL)
- errorx(1, "unable to allocate memory");
+ errorx(1, _("unable to allocate memory"));
return ptr;
}
{
if (size == 0)
- errorx(1, "internal error, tried to erealloc(0)");
+ errorx(1, _("internal error, tried to erealloc(0)"));
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
- errorx(1, "unable to allocate memory");
+ errorx(1, _("unable to allocate memory"));
return ptr;
}
{
if (nmemb == 0 || size == 0)
- errorx(1, "internal error, tried to erealloc3(0)");
+ errorx(1, _("internal error, tried to erealloc3(0)"));
if (nmemb > SIZE_MAX / size)
- errorx(1, "internal error, erealloc3() overflow");
+ errorx(1, _("internal error, erealloc3() overflow"));
size *= nmemb;
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
- errorx(1, "unable to allocate memory");
+ errorx(1, _("unable to allocate memory"));
return ptr;
}
va_end(ap);
if (len == -1)
- errorx(1, "unable to allocate memory");
+ errorx(1, _("unable to allocate memory"));
return len;
}
int len;
if ((len = vasprintf(ret, format, args)) == -1)
- errorx(1, "unable to allocate memory");
+ errorx(1, _("unable to allocate memory"));
return len;
}