swh:1:snp:47f1e8bb459169b0feb652a9c3d9cbabd8526d4a
Raw File
Tip revision: 53f9a3e157dbbc901a02ac2c73346d375e24978c authored by Junio C Hamano on 21 June 2018, 17:00:06 UTC
Git 2.18
Tip revision: 53f9a3e
strdup.c
#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;
}
back to top