shithub: scc

ref: 2ee4c38b7e9809aefb5c8cb1f874444928a0b188
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);
}