Staging
v0.5.1
https://github.com/python/cpython
Revision fc662ddda2bfd43b10c0a4f8a814e36445f22515 authored by Éric Araujo on 28 July 2011, 21:00:14 UTC, committed by Éric Araujo on 28 July 2011, 21:00:14 UTC
2 parent s f5e10d1 + ee19c77
Raw File
Tip revision: fc662ddda2bfd43b10c0a4f8a814e36445f22515 authored by Éric Araujo on 28 July 2011, 21:00:14 UTC
Merge profile docs followup (#12417) from 3.1
Tip revision: fc662dd
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