Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 4452cdcb79fdade13c00eabe63304efa4da1c3ad authored by Larry Hastings on 09 September 2019, 13:39:36 UTC
Sphinx 1.8 is now preferred for building 3.5 docs.
Tip revision: 4452cdc
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