Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: d2f3857c40a340f252397eb16b4289403af8bf76 authored by Georg Brandl on 30 January 2011, 08:37:19 UTC
#10961: fix exception handling in new pydoc server code.
Tip revision: d2f3857
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