aboutsummaryrefslogtreecommitdiff
path: root/src/error.c
diff options
context:
space:
mode:
authorbeber <beber>2005-08-22 18:11:55 +0000
committerbeber <beber>2005-08-22 18:11:55 +0000
commit90d14934dbe4d136301be0a54f83c1afa5226f25 (patch)
tree6ba3cc13e2205e0607f0ae36a93fad691f7ce5b0 /src/error.c
parentMakefile : ebic -> espik (diff)
downloadespik-90d14934dbe4d136301be0a54f83c1afa5226f25.tar.xz
error.c -> espik_error.c
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c14
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);
+ }
+}