shithub: scc

ref: a0796b4c04fdb332658a59a571897a4db17a3bbe
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);
}