swh:1:snp:47f1e8bb459169b0feb652a9c3d9cbabd8526d4a
Raw File
Tip revision: 94f6e3e283f2adfc518b39cfc39291f1c2832ad0 authored by Johannes Schindelin on 12 February 2021, 14:51:13 UTC
Git 2.30.2
Tip revision: 94f6e3e
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