Code & Deploy
Code
Models
Repos
Sign in
@leroysheep
/
LeeRoySheep
LeeRoySheep
/
compat
/
strdup.c
Code
Commits
Pulls
CI/CD
81,972
jch
bisect
jch
maint
master
next
seen
test
todo
c
11 lines
169 Bytes
Copy permalink
Copy
Raw
1
#include
"../git-compat-util.h"
2
3
char
*
gitstrdup
(
const
char
*
s1
)
4
{
5
size_t
len
=
strlen
(
s1
)
+
1
;
6
char
*
s2
=
malloc
(
len
);
7
8
if
(
s2
)
9
memcpy
(
s2
,
s1
,
len
);
10
return
s2
;
11
}