Staging
v0.5.1
Revision 5c26a8afbb6fa43a35e8a1d6942157209890437a authored by Larry Hastings on 18 May 2014, 04:46:35 UTC, committed by Larry Hastings on 18 May 2014, 04:46:35 UTC
1 parent d08aa47
Raw File
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

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