make the malloc(0) error specific to each function to aid tracking down

bugs.
This commit is contained in:
Todd C. Miller
2003-03-15 20:10:42 +00:00
parent 8d8b597963
commit bb2c3323d9

View File

@@ -94,7 +94,7 @@ emalloc(size)
VOID *ptr; VOID *ptr;
if (size == 0) { if (size == 0) {
(void) fprintf(stderr, "%s: internal error, tried to malloc(0)\n", (void) fprintf(stderr, "%s: internal error, tried to emalloc(0)\n",
Argv[0]); Argv[0]);
exit(1); exit(1);
} }
@@ -117,7 +117,7 @@ emalloc2(nmemb, size)
VOID *ptr; VOID *ptr;
if (nmemb == 0 || size == 0) { if (nmemb == 0 || size == 0) {
(void) fprintf(stderr, "%s: internal error, tried to malloc(0)\n", (void) fprintf(stderr, "%s: internal error, tried to emalloc2(0)\n",
Argv[0]); Argv[0]);
exit(1); exit(1);
} }
@@ -146,7 +146,7 @@ erealloc(ptr, size)
{ {
if (size == 0) { if (size == 0) {
(void) fprintf(stderr, "%s: internal error, tried to realloc(0)\n", (void) fprintf(stderr, "%s: internal error, tried to erealloc(0)\n",
Argv[0]); Argv[0]);
exit(1); exit(1);
} }
@@ -172,7 +172,7 @@ erealloc3(ptr, nmemb, size)
{ {
if (nmemb == 0 || size == 0) { if (nmemb == 0 || size == 0) {
(void) fprintf(stderr, "%s: internal error, tried to realloc(0)\n", (void) fprintf(stderr, "%s: internal error, tried to erealloc3(0)\n",
Argv[0]); Argv[0]);
exit(1); exit(1);
} }