Staging
v0.5.1
https://github.com/python/cpython
Revision adadc0f56fa2c5e6e695e34b1bd4b72640ecd089 authored by Tim Peters on 31 August 2004, 14:29:12 UTC, committed by Tim Peters on 31 August 2004, 14:29:12 UTC
1 parent 3d3db96
Raw File
Tip revision: adadc0f56fa2c5e6e695e34b1bd4b72640ecd089 authored by Tim Peters on 31 August 2004, 14:29:12 UTC
Remove rotor and xreadlines from VC 7.1 build.
Tip revision: adadc0f
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