Staging
v0.5.1
https://github.com/python/cpython
Revision 608c2135302386d006291438b388c99b957291eb authored by Serhiy Storchaka on 07 November 2015, 09:16:10 UTC, committed by Serhiy Storchaka on 07 November 2015, 09:16:10 UTC
1 parent eeb896c
Raw File
Tip revision: 608c2135302386d006291438b388c99b957291eb authored by Serhiy Storchaka on 07 November 2015, 09:16:10 UTC
Issue #892902: Added new tests for pickling recursive collections.
Tip revision: 608c213
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