Staging
v0.5.1
Revision d78cec5f39646f62384558fb85725427559426dc authored by Benjamin Peterson on 05 December 2009, 17:47:56 UTC, committed by Benjamin Peterson on 05 December 2009, 17:47:56 UTC
1 parent 3b94c0b
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