Staging
v0.5.1
https://github.com/python/cpython
Revision c2f86d86e6c8f5fd1ef602128b537a48f3f5c063 authored by Benjamin Peterson on 19 October 2019, 18:38:44 UTC, committed by Benjamin Peterson on 19 October 2019, 18:38:44 UTC
1 parent 74ceb35
Raw File
Tip revision: c2f86d86e6c8f5fd1ef602128b537a48f3f5c063 authored by Benjamin Peterson on 19 October 2019, 18:38:44 UTC
Empty blurb file for 2.7.17.
Tip revision: c2f86d8
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
	if (str != NULL) {
		register char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top