Staging
v0.8.1
Revision bfe36ec1f580248d5e718667c204974275f8974a authored by Georg Brandl on 12 May 2013, 10:28:20 UTC, committed by Georg Brandl on 12 May 2013, 10:28:20 UTC
1 parent c502df4
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