diff options
author | beber <beber> | 2005-08-22 18:11:55 +0000 |
---|---|---|
committer | beber <beber> | 2005-08-22 18:11:55 +0000 |
commit | 90d14934dbe4d136301be0a54f83c1afa5226f25 (patch) | |
tree | 6ba3cc13e2205e0607f0ae36a93fad691f7ce5b0 /src/error.c | |
parent | Makefile : ebic -> espik (diff) | |
download | espik-90d14934dbe4d136301be0a54f83c1afa5226f25.tar.xz |
error.c -> espik_error.c
Diffstat (limited to 'src/error.c')
-rw-r--r-- | src/error.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/error.c b/src/error.c new file mode 100644 index 0000000..e8303dc --- /dev/null +++ b/src/error.c @@ -0,0 +1,14 @@ +#include "espik_error.h" + +#include <stdio.h> /* fprintf */ +#include <stdlib.h> /* exit */ + +void chk_malloc (void *ptr) +{ + if (ptr == NULL) + { + fprintf (stderr, "Malloc failed\n"); + fprintf (stderr, "exiting ...\n"); + exit (128); + } +} |