shithub: scc

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