code: purgatorio

ref: 6c2f8fd5e4f0e0be44495a5526930fa3760cd87e
dir: /lib9/strdup.c/

View raw version
#include "lib9.h"

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

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