summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index c046d30..886ed99 100644
--- a/src/main.c
+++ b/src/main.c
@@ -71,8 +71,10 @@ fatal (const char *msg)
void *
xmalloc (size_t size)
{
- register void *value = malloc (size);
- if (value == 0)
+ void *value;
+
+ value = malloc (size);
+ if (value == NULL)
fatal ("Virtual memory exhausted");
return value;
}
@@ -80,8 +82,10 @@ xmalloc (size_t size)
void *
xrealloc (void *ptr, size_t size)
{
- register void *value = realloc (ptr, size);
- if (value == 0)
+ void *value;
+
+ value = realloc (ptr, size);
+ if (value == NULL)
fatal ("Virtual memory exhausted");
return value;
}
@@ -91,7 +95,7 @@ xstrdup (const char *s)
{
char *value;
value = strdup (s);
- if (value == 0)
+ if (value == NULL)
fatal ("Virtual memory exhausted");
return value;
}