diff options
author | Benny Baumann <BenBE@geshi.org> | 2020-10-15 00:56:22 +0200 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2020-10-17 20:54:14 +0200 |
commit | 5e4b1826168b74d8b5e71227ded12980efd5a243 (patch) | |
tree | d1b5ce276eb0ba146abaabb8ae1ddda793d230c0 /XAlloc.c | |
parent | 872e542f4eca52ce2198ba3fc30a51bc5d672dae (diff) |
Combine XAlloc.[ch] into XUtils.[ch]
Diffstat (limited to 'XAlloc.c')
-rw-r--r-- | XAlloc.c | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/XAlloc.c b/XAlloc.c deleted file mode 100644 index 815cf47f..00000000 --- a/XAlloc.c +++ /dev/null @@ -1,42 +0,0 @@ - -#include "XAlloc.h" -#include "RichString.h" - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include <stdarg.h> -#include <stdlib.h> -#include <string.h> - - -void fail() { - curs_set(1); - endwin(); - abort(); -} - -void* xMalloc(size_t size) { - void* data = malloc(size); - if (!data && size > 0) { - fail(); - } - return data; -} - -void* xCalloc(size_t nmemb, size_t size) { - void* data = calloc(nmemb, size); - if (!data && nmemb > 0 && size > 0) { - fail(); - } - return data; -} - -void* xRealloc(void* ptr, size_t size) { - void* data = realloc(ptr, size); - if (!data && size > 0) { - fail(); - } - return data; -} |