defined why2_strdup

I hope I won't fuck up anything by this
This commit is contained in:
Václav Šmejkal 2023-02-01 15:10:10 +01:00
parent d5ae68c621
commit 0b4ca30ec9
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -7,9 +7,7 @@
#include <why2/memory.h> #include <why2/memory.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <string.h>
#include <why2/flags.h>
//LOCAL //LOCAL
typedef struct node typedef struct node
@ -107,6 +105,15 @@ void *why2_realloc(void *pointer, unsigned long size)
return allocated; return allocated;
} }
char *why2_strdup(char *string)
{
char *allocated = strdup(string);
push_to_list(allocated);
return allocated;
}
void why2_free(void *pointer) void why2_free(void *pointer)
{ {
//VARIABLES //VARIABLES