summaryrefslogtreecommitdiff
path: root/src/string/strdup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/strdup.c')
-rw-r--r--src/string/strdup.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/string/strdup.c b/src/string/strdup.c
index 7b97f75d..26362e2f 100644
--- a/src/string/strdup.c
+++ b/src/string/strdup.c
@@ -1,10 +1,12 @@
-#if 0
-
#include <string.h>
#include <stdlib.h>
+#include "_safety.h"
+#undef strdup
char * strdup(const char *s)
{
+ SIGNAL_SAFE(0);
+
size_t len = strlen(s);
char *ret = malloc(len + 1);
if (ret) {
@@ -17,6 +19,3 @@ char * strdup(const char *s)
XOPEN(400)
POSIX(200809)
*/
-
-
-#endif