Staging
v0.5.1
https://github.com/python/cpython
Revision d384df407ebdbb1ab386597658f1ac78e8803afe authored by Ned Deily on 17 June 2020, 10:59:51 UTC, committed by Ned Deily on 17 June 2020, 10:59:51 UTC
1 parent 7df32f8
Raw File
Tip revision: d384df407ebdbb1ab386597658f1ac78e8803afe authored by Ned Deily on 17 June 2020, 10:59:51 UTC
3.6.11rc1
Tip revision: d384df4
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