Permalink
Browse files

Enhance the out-of-memory error messages

  • Loading branch information...
1 parent a12643f commit 556b7f4fe63cc4b528f1504d253e1ff4c21e849f @catwood committed Nov 1, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/utils.c
View
@@ -30,7 +30,7 @@ void *xmalloc(size_t size)
{
void *r = malloc(size);
if (r == NULL) {
- printf("[ERR] Not enougth memory\n");
+ printf("[ERR] Not enough memory to xmalloc %lu\n", (unsigned long)size);
exit(0);
}
return r;
@@ -40,7 +40,7 @@ void *xrealloc(void *ptr, size_t size)
{
void *r = realloc(ptr, size);
if (r == NULL) {
- printf("[ERR] Not enougth memory\n");
+ printf("[ERR] Not enough memory to realloc %lu\n", (unsigned long)size);
exit(0);
}
return r;
@@ -183,7 +183,7 @@ char *xstrdup(const char *s)
{
char *x = strdup(s);
if (x == NULL) {
- printf("[ERR] Not enougth memory\n");
+ printf("[ERR] Not enough memory\n");
exit(0);
}
return x;

0 comments on commit 556b7f4

Please sign in to comment.