Staging
v0.5.1
Revision e5b9bff214584fa088cdf616f96d44eec69dd743 authored by Martin v. Löwis on 31 October 2011, 11:38:50 UTC, committed by Martin v. Löwis on 31 October 2011, 11:38:50 UTC
1 parent 228516c
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