Staging
v0.5.1
https://github.com/python/cpython
Revision b44c4520d965788aa6d24edab36d89103b0a1aea authored by Martin Panter on 29 May 2016, 08:13:58 UTC, committed by Martin Panter on 29 May 2016, 08:13:58 UTC
1 parent 6ee36a5
Raw File
Tip revision: b44c4520d965788aa6d24edab36d89103b0a1aea authored by Martin Panter on 29 May 2016, 08:13:58 UTC
Issue #27125: Fix various errors like “will [be] inherited”
Tip revision: b44c452
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