Staging
v0.5.1
https://github.com/python/cpython
Revision 493fef60a7600f83fe6916ed89d0fb0c0aab484d authored by Serhiy Storchaka on 26 October 2019, 14:30:30 UTC, committed by GitHub on 26 October 2019, 14:30:30 UTC
1 parent c80955c
Raw File
Tip revision: 493fef60a7600f83fe6916ed89d0fb0c0aab484d authored by Serhiy Storchaka on 26 October 2019, 14:30:30 UTC
[2.7] bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861). (GH-16931)
Tip revision: 493fef6
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