Staging
v0.5.1
Revision 103e32355dc2a343f2847100662220cccbf9154c authored by Barry Warsaw on 29 September 2009, 22:41:09 UTC, committed by Barry Warsaw on 29 September 2009, 22:41:09 UTC
1 parent 61df9e5
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