shithub: scc

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