swh:1:snp:47f1e8bb459169b0feb652a9c3d9cbabd8526d4a
Raw File
Tip revision: ac84098b7e32406a982ac01cc76a663d5605224b authored by Junio C Hamano on 28 October 2016, 16:02:44 UTC
Git 2.10.2
Tip revision: ac84098
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