summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-01-21 22:27:59 +0100
committertomsmeding <tom.smeding@gmail.com>2017-01-21 22:27:59 +0100
commit9c2bef9f407ab1e9fcd4afff430fee5d565b7e87 (patch)
treeddaf6e4f6f1efc97ff4d242ddf690afe4e712316 /memory.c
parented1f63961c96db6491b607ce41ec01d53b4e64a0 (diff)
Level generation! Also push support in tcpHEADmaster
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 6f8253f..1afa475 100644
--- a/memory.c
+++ b/memory.c
@@ -1,6 +1,14 @@
#include <stdio.h>
#include "memory.h"
+#undef memdup
+
+void* memdup(void *buf, size_t num){
+ if(buf == NULL) return NULL;
+ char *buf2 = malloc(num, char);
+ memcpy(buf2, buf, num);
+ return (void*)buf2;
+}
void* check_after_allocation(const char *funcname, void *ptr){
if(ptr == NULL){