Staging
v0.5.1
https://github.com/python/cpython
Revision 999d0f9af043515a942122b2f0c783ae1b976f18 authored by Vinay Sajip on 13 December 2015, 09:41:29 UTC, committed by Vinay Sajip on 13 December 2015, 09:41:29 UTC
1 parent 13cf490
Raw File
Tip revision: 999d0f9af043515a942122b2f0c783ae1b976f18 authored by Vinay Sajip on 13 December 2015, 09:41:29 UTC
Fixes #25844: Corrected =/== typo potentially leading to crash in launcher.
Tip revision: 999d0f9
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