code: 9ferno

ref: 966a5434d9bbbc089bc07b71e158ed165fd64422
dir: /libkern/strdup.c/

View raw version
#include <lib9.h>

char*
strdup(char *s) 
{  
	char *os;

	os = malloc(strlen(s) + 1);
	if(os == 0)
		return 0;
	return strcpy(os, s);
}