Revision 215b6b392d8530dee3e33caf12249dadfe71c07f authored by Giampaolo RodolĂ  on 06 May 2010, 19:56:34 UTC, committed by Giampaolo RodolĂ  on 06 May 2010, 19:56:34 UTC
1 parent f7454fa
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