From 0b4ca30ec9ea997d49741fd7ad47f8f759444f1f Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 1 Feb 2023 15:10:10 +0100 Subject: [PATCH] defined why2_strdup I hope I won't fuck up anything by this --- src/core/lib/utils/memory.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/lib/utils/memory.c b/src/core/lib/utils/memory.c index e58f558..7cca62e 100644 --- a/src/core/lib/utils/memory.c +++ b/src/core/lib/utils/memory.c @@ -7,9 +7,7 @@ #include #include -#include - -#include +#include //LOCAL typedef struct node @@ -107,6 +105,15 @@ void *why2_realloc(void *pointer, unsigned long size) return allocated; } +char *why2_strdup(char *string) +{ + char *allocated = strdup(string); + + push_to_list(allocated); + + return allocated; +} + void why2_free(void *pointer) { //VARIABLES