diff options
Diffstat (limited to '')
-rw-r--r-- | test.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -3,6 +3,9 @@ #include "test.h" #include <malloc.h> +#undef strndup +#undef memdup + size_t alloc_fail_in = 0; @@ -185,6 +188,28 @@ pvalloc(size_t size) } +char * +strdup(const char *s) +{ + char *r = malloc(strlen(s) + 1); + return r ? strcpy(r, s) : r; +} + + +char * +strndup(const char *s, size_t size) +{ + return libsimple_strndup(s, size); +} + + +void * +memdup(const void *s, size_t size) +{ + return libsimple_memdup(s, size); +} + + void free(void *ptr) { |