shithub: scc

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