shithub: scc

ref: 05e48648c32fff671b79a615310f4d2bc5136aba
dir: /lib/xstrdup.c/

View raw version
/* See LICENSE file for copyright and license details. */
#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);
}