Staging
v0.5.1
https://github.com/python/cpython
Revision c489a767af46f33e73d96a5746e46a7365814db2 authored by Miss Islington (bot) on 28 May 2018, 20:16:07 UTC, committed by GitHub on 28 May 2018, 20:16:07 UTC
(cherry picked from commit e97ba4c690613d734843db218aeedce2f0e5937f)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
1 parent 6ec325d
Raw File
Tip revision: c489a767af46f33e73d96a5746e46a7365814db2 authored by Miss Islington (bot) on 28 May 2018, 20:16:07 UTC
bpo-33614: Ensures module definition files for the stable ABI on Windows are correctly regenerated. (GH-7165)
Tip revision: c489a76
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
	if (str != NULL) {
		char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top