Staging
v0.5.1
https://github.com/python/cpython
Revision 6b6756f1283a87091c6186e70b544d4789e12c51 authored by Miss Islington (bot) on 14 March 2020, 22:17:10 UTC, committed by GitHub on 14 March 2020, 22:17:10 UTC
(cherry picked from commit e5e56328afac50aad6d8893185d8e7ba8928afe2)

Co-authored-by: Antoine <43954001+awecx@users.noreply.github.com>
1 parent cebe9ee
Raw File
Tip revision: 6b6756f1283a87091c6186e70b544d4789e12c51 authored by Miss Islington (bot) on 14 March 2020, 22:17:10 UTC
bpo-39869: Fix typo in 'Instance objects' section. (GH-18889) (GH-18898)
Tip revision: 6b6756f
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