Revision 42e6fde5c28150206956ea4be490d886c4ecbd68 authored by Junio C Hamano on 22 September 2017, 05:49:24 UTC, committed by Junio C Hamano on 22 September 2017, 05:49:24 UTC
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1df0306
Raw File
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