From 4dbdc42d9e7c3968ff7f690d00680419c9b8cb0f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 9 Apr 2024 15:34:27 +0200 Subject: Adding upstream version 1:2.43.0. Signed-off-by: Daniel Baumann --- compat/strdup.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 compat/strdup.c (limited to 'compat/strdup.c') diff --git a/compat/strdup.c b/compat/strdup.c new file mode 100644 index 0000000..f3fb978 --- /dev/null +++ b/compat/strdup.c @@ -0,0 +1,11 @@ +#include "../git-compat-util.h" + +char *gitstrdup(const char *s1) +{ + size_t len = strlen(s1) + 1; + char *s2 = malloc(len); + + if (s2) + memcpy(s2, s1, len); + return s2; +} -- cgit v1.2.3