shithub: scc

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