shithub: scc

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