Staging
v0.8.1
https://github.com/python/cpython
Revision f74cabd9203cf3be97fdb3821a7fa0b74d7b2263 authored by Ned Deily on 11 December 2018, 09:28:31 UTC, committed by GitHub on 11 December 2018, 09:28:31 UTC
1 parent 8855d93
Raw File
Tip revision: f74cabd9203cf3be97fdb3821a7fa0b74d7b2263 authored by Ned Deily on 11 December 2018, 09:28:31 UTC
[3.6] bpo-15663: the 10.6+ macOS installers for 3.6/2.7 now provide a private Tcl/Tk 8.6 (GH-11109)
Tip revision: f74cabd
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