Staging
v0.5.1
https://github.com/python/cpython
Revision 7574a1a8916639075dce3534aae8a54e977e06e9 authored by Zachary Ware on 11 February 2018, 19:56:57 UTC, committed by GitHub on 11 February 2018, 19:56:57 UTC
(cherry picked from commit 28607e0dd9417ce44a109980ffd60697c1afdea0)
1 parent 9d8c24b
Raw File
Tip revision: 7574a1a8916639075dce3534aae8a54e977e06e9 authored by Zachary Ware on 11 February 2018, 19:56:57 UTC
[3.6] Add short-circuit for doc changes to AppVeyor (GH-5628)
Tip revision: 7574a1a
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