Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 50af011ca60c4021c78c766b85c1af9960d98f8f authored by Georg Brandl on 01 April 2012, 11:49:21 UTC
Bump to 3.3.0a2.
Tip revision: 50af011
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