2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Rename warning2()/error2() -> warning_nodebug()/error_nodebug().

This commit is contained in:
Todd C. Miller
2012-11-25 09:34:10 -05:00
parent 7b3d268687
commit 4bde57b8b2
10 changed files with 79 additions and 79 deletions

View File

@@ -80,10 +80,10 @@ emalloc(size_t size)
void *ptr;
if (size == 0)
errorx2(1, _("internal error, tried to emalloc(0)"));
errorx_nodebug(1, _("internal error, tried to emalloc(0)"));
if ((ptr = malloc(size)) == NULL)
errorx2(1, NULL);
errorx_nodebug(1, NULL);
return ptr;
}
@@ -97,13 +97,13 @@ emalloc2(size_t nmemb, size_t size)
void *ptr;
if (nmemb == 0 || size == 0)
errorx2(1, _("internal error, tried to emalloc2(0)"));
errorx_nodebug(1, _("internal error, tried to emalloc2(0)"));
if (nmemb > SIZE_MAX / size)
errorx2(1, _("internal error, %s overflow"), "emalloc2()");
errorx_nodebug(1, _("internal error, %s overflow"), "emalloc2()");
size *= nmemb;
if ((ptr = malloc(size)) == NULL)
errorx2(1, NULL);
errorx_nodebug(1, NULL);
return ptr;
}
@@ -118,14 +118,14 @@ ecalloc(size_t nmemb, size_t size)
void *ptr;
if (nmemb == 0 || size == 0)
errorx2(1, _("internal error, tried to ecalloc(0)"));
errorx_nodebug(1, _("internal error, tried to ecalloc(0)"));
if (nmemb != 1) {
if (nmemb > SIZE_MAX / size)
errorx2(1, _("internal error, %s overflow"), "ecalloc()");
errorx_nodebug(1, _("internal error, %s overflow"), "ecalloc()");
size *= nmemb;
}
if ((ptr = malloc(size)) == NULL)
errorx2(1, NULL);
errorx_nodebug(1, NULL);
memset(ptr, 0, size);
return ptr;
}
@@ -140,11 +140,11 @@ erealloc(void *ptr, size_t size)
{
if (size == 0)
errorx2(1, _("internal error, tried to erealloc(0)"));
errorx_nodebug(1, _("internal error, tried to erealloc(0)"));
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
errorx2(1, NULL);
errorx_nodebug(1, NULL);
return ptr;
}
@@ -159,14 +159,14 @@ erealloc3(void *ptr, size_t nmemb, size_t size)
{
if (nmemb == 0 || size == 0)
errorx2(1, _("internal error, tried to erealloc3(0)"));
errorx_nodebug(1, _("internal error, tried to erealloc3(0)"));
if (nmemb > SIZE_MAX / size)
errorx2(1, _("internal error, %s overflow"), "erealloc3()");
errorx_nodebug(1, _("internal error, %s overflow"), "erealloc3()");
size *= nmemb;
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
errorx2(1, NULL);
errorx_nodebug(1, NULL);
return ptr;
}
@@ -183,14 +183,14 @@ erecalloc(void *ptr, size_t onmemb, size_t nmemb, size_t msize)
size_t size;
if (nmemb == 0 || msize == 0)
errorx2(1, _("internal error, tried to erecalloc(0)"));
errorx_nodebug(1, _("internal error, tried to erecalloc(0)"));
if (nmemb > SIZE_MAX / msize)
errorx2(1, _("internal error, %s overflow"), "erecalloc()");
errorx_nodebug(1, _("internal error, %s overflow"), "erecalloc()");
size = nmemb * msize;
ptr = ptr ? realloc(ptr, size) : malloc(size);
if (ptr == NULL)
errorx2(1, NULL);
errorx_nodebug(1, NULL);
if (nmemb > onmemb) {
size = (nmemb - onmemb) * msize;
memset((char *)ptr + (onmemb * msize), 0, size);
@@ -255,7 +255,7 @@ easprintf(char **ret, const char *fmt, ...)
va_end(ap);
if (len == -1)
errorx2(1, NULL);
errorx_nodebug(1, NULL);
return len;
}
@@ -269,7 +269,7 @@ evasprintf(char **ret, const char *format, va_list args)
int len;
if ((len = vasprintf(ret, format, args)) == -1)
errorx2(1, NULL);
errorx_nodebug(1, NULL);
return len;
}