Staging
v0.5.1
Revision a2aa2ef3136e4190d533447e13a79b49522eb0ce authored by Benjamin Peterson on 23 February 2012, 15:52:17 UTC, committed by Benjamin Peterson on 23 February 2012, 15:52:17 UTC
1 parent a13294e
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