Staging
v0.5.1
https://github.com/python/cpython
Revision 0f3629d913a608f43ba115064f03ad3c9f1f21ec authored by Georg Brandl on 07 September 2008, 17:00:17 UTC, committed by Georg Brandl on 07 September 2008, 17:00:17 UTC
1 parent cc023f1
Raw File
Tip revision: 0f3629d913a608f43ba115064f03ad3c9f1f21ec authored by Georg Brandl on 07 September 2008, 17:00:17 UTC
Add a new howto about Python and the web, by Marek Kubica.
Tip revision: 0f3629d
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