shithub: riscv

ref: 8a45afd47d2545b2d85aecf9ec5af90cba3905d3
dir: /sys/src/libventi/strdup.c/

View raw version
#include <u.h>
#include <libc.h>
#include <venti.h>

char*
vtstrdup(char *s)
{
	int n;
	char *ss;

	if(s == nil)
		return nil;
	n = strlen(s) + 1;
	ss = vtmalloc(n);
	memmove(ss, s, n);
	return ss;
}