Staging
v0.5.1
https://github.com/python/cpython
Revision f15aee54bd38cfde8331b1f325af0009516714c8 authored by Moshe Zadka on 30 March 2001, 16:49:07 UTC, committed by Moshe Zadka on 30 March 2001, 16:49:07 UTC
1 parent 5f45415
Raw File
Tip revision: f15aee54bd38cfde8331b1f325af0009516714c8 authored by Moshe Zadka on 30 March 2001, 16:49:07 UTC
Fixing #121965 -- containment in xrange objects.
Tip revision: f15aee5
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