shithub: scc

ref: 292c2611dbb22bc78f2fea52eda82252f071491b
dir: /lib/xstrdup.c/

View raw version
#include <string.h>
#include <cc.h>

char *
xstrdup(const char *s)
{
	register size_t len = strlen(s) + 1;
	register char *p = xmalloc(len);

	return memcpy(p, s, len);
}