From 5c745cccbe1774780f499e5cc979eb77d2aac5c7 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 5 Jul 2016 07:03:17 +0200 Subject: lib: utils: deprecate strdup When introducing robust mutexes, ouroboros moved to POSIX 200809L which includes the strdup function in . Including will give access to strdup. Fixes #15. --- src/lib/irm.c | 2 +- src/lib/utils.c | 19 ------------------- 2 files changed, 1 insertion(+), 20 deletions(-) (limited to 'src/lib') diff --git a/src/lib/irm.c b/src/lib/irm.c index 68ffdf03..8f475e38 100644 --- a/src/lib/irm.c +++ b/src/lib/irm.c @@ -22,12 +22,12 @@ #define OUROBOROS_PREFIX "libouroboros-irm" +#include #include #include #include #include #include -#include #include #include diff --git a/src/lib/utils.c b/src/lib/utils.c index 49065138..acaf1176 100644 --- a/src/lib/utils.c +++ b/src/lib/utils.c @@ -35,25 +35,6 @@ int n_digits(unsigned i) return n; } -char * strdup(const char * src) -{ - int len = 0; - char * dst = NULL; - - if (src == NULL) - return NULL; - - len = strlen(src) + 1; - - dst = malloc(len); - if (dst == NULL) - return NULL; - - memcpy(dst, src, len); - - return dst; -} - char * path_strip(char * src) { char * dst = NULL; -- cgit v1.2.3