https://github.com/git/git
Raw File
Tip revision: edae91a4cf221d44c8c891d5519b26fce17d56bb authored by Junio C Hamano on 13 February 2024, 22:47:02 UTC
Git 2.44-rc1
Tip revision: edae91a
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