shithub: scc

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