Prepare sudo front end messages for translation.
This commit is contained in:
@@ -76,10 +76,10 @@ emalloc(size_t size)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -93,13 +93,13 @@ emalloc2(size_t nmemb, size_t size)
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -113,11 +113,11 @@ erealloc(void *ptr, size_t size)
|
||||
{
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -132,14 +132,14 @@ erealloc3(void *ptr, size_t nmemb, size_t size)
|
||||
{
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ easprintf(char **ret, const char *fmt, ...)
|
||||
va_end(ap);
|
||||
|
||||
if (len == -1)
|
||||
errorx(1, "unable to allocate memory");
|
||||
errorx(1, _("unable to allocate memory"));
|
||||
return len;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ evasprintf(char **ret, const char *format, va_list args)
|
||||
int len;
|
||||
|
||||
if ((len = vasprintf(ret, format, args)) == -1)
|
||||
errorx(1, "unable to allocate memory");
|
||||
errorx(1, _("unable to allocate memory"));
|
||||
return len;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user