Staging
v0.5.1
Revision eee44f28a93adbf8ff0b9391ddd0e77e99bbc55f authored by Zachary Ware on 06 February 2014, 21:46:38 UTC, committed by Zachary Ware on 06 February 2014, 21:46:38 UTC
1 parent a26b3f1
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