Staging
v0.5.0
https://github.com/python/cpython
Raw File
Tip revision: 29360893df0931703cb2fe0c0fbc0fc963e64ead authored by Georg Brandl on 20 February 2011, 10:31:59 UTC
Make a 3.2 maintenance branch.
Tip revision: 2936089
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