Staging
v0.8.1
https://github.com/python/cpython
Revision 627d0c61ac96009450e3794a2401f244e56fcb79 authored by Larry Hastings on 02 August 2018, 09:19:12 UTC, committed by Larry Hastings on 02 August 2018, 09:19:12 UTC
1 parent b86a50f
Raw File
Tip revision: 627d0c61ac96009450e3794a2401f244e56fcb79 authored by Larry Hastings on 02 August 2018, 09:19:12 UTC
Version bump for 3.5.6 final.
Tip revision: 627d0c6
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