shithub: scc

ref: 11c2f9d8aedc5338cdb03b6c53d9461e12f9aaaa
dir: /lib/xstrdup.c/

View raw version

#include <string.h>
#include "../inc/cc.h"

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

	return memcpy(p, s, len);
}