Skip to content

Commit

Permalink
Enhance the out-of-memory error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
catwood committed Nov 1, 2012
1 parent a12643f commit 556b7f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.c
Expand Up @@ -30,7 +30,7 @@ void *xmalloc(size_t size)
{ {
void *r = malloc(size); void *r = malloc(size);
if (r == NULL) { if (r == NULL) {
printf("[ERR] Not enougth memory\n"); printf("[ERR] Not enough memory to xmalloc %lu\n", (unsigned long)size);
exit(0); exit(0);
} }
return r; return r;
Expand All @@ -40,7 +40,7 @@ void *xrealloc(void *ptr, size_t size)
{ {
void *r = realloc(ptr, size); void *r = realloc(ptr, size);
if (r == NULL) { if (r == NULL) {
printf("[ERR] Not enougth memory\n"); printf("[ERR] Not enough memory to realloc %lu\n", (unsigned long)size);
exit(0); exit(0);
} }
return r; return r;
Expand Down Expand Up @@ -183,7 +183,7 @@ char *xstrdup(const char *s)
{ {
char *x = strdup(s); char *x = strdup(s);
if (x == NULL) { if (x == NULL) {
printf("[ERR] Not enougth memory\n"); printf("[ERR] Not enough memory\n");
exit(0); exit(0);
} }
return x; return x;
Expand Down

0 comments on commit 556b7f4

Please sign in to comment.