Staging
v0.5.0
https://github.com/python/cpython
Raw File
Tip revision: a12d0ccfbe189ba7f3ed99cb1feac69aa03d7fe0 authored by Barry Warsaw on 10 April 2012, 14:59:35 UTC
Bump to 2.6.8
Tip revision: a12d0cc
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