Staging
v0.8.1
Revision 7fc8a105777fc7899cb6de15fe2d392bf4c361f5 authored by Benjamin Peterson on 14 April 2014, 23:57:52 UTC, committed by Benjamin Peterson on 14 April 2014, 23:57:52 UTC
1 parent 5c863bf
Raw File
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
	if (str != NULL) {
		register char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top