Staging
v0.5.1
Revision 00305ade58f722e051a40638ae354a1067595a3b authored by Raymond Hettinger on 17 November 2016, 06:56:11 UTC, committed by Raymond Hettinger on 17 November 2016, 06:56:11 UTC
1 parent 2589ee3
Raw File
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
	if (str != NULL) {
		char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top