Staging
v0.5.1
Revision b5d174037fab4889c1404ebab19b85cbe9aa452e authored by Barry Warsaw on 19 June 2008, 01:48:07 UTC, committed by Barry Warsaw on 19 June 2008, 01:48:07 UTC
1 parent da9c9be
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