summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libregex/test/xmalloc.c
diff options
context:
space:
mode:
authorconklin <conklin@FreeBSD.org>1993-07-30 20:16:53 +0000
committerconklin <conklin@FreeBSD.org>1993-07-30 20:16:53 +0000
commit5e0c8d9ee2600d5f7d5c710e34249ae51db60ba7 (patch)
treee01cf2a5cc6062467dbb628a7beef06eaa39845d /gnu/lib/libregex/test/xmalloc.c
parent605993f7be3eb2154f219e29b739c6d76f373405 (diff)
downloadFreeBSD-src-5e0c8d9ee2600d5f7d5c710e34249ae51db60ba7.zip
FreeBSD-src-5e0c8d9ee2600d5f7d5c710e34249ae51db60ba7.tar.gz
GNU Regex 0.12
Diffstat (limited to 'gnu/lib/libregex/test/xmalloc.c')
-rw-r--r--gnu/lib/libregex/test/xmalloc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gnu/lib/libregex/test/xmalloc.c b/gnu/lib/libregex/test/xmalloc.c
new file mode 100644
index 0000000..88be1a6
--- /dev/null
+++ b/gnu/lib/libregex/test/xmalloc.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+extern char *malloc ();
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+void *
+xmalloc (size)
+ unsigned size;
+{
+ char *new_mem = malloc (size);
+
+ if (new_mem == NULL)
+ {
+ fprintf (stderr, "xmalloc: request for %u bytes failed.\n", size);
+ abort ();
+ }
+
+ return new_mem;
+}
OpenPOWER on IntegriCloud