Staging
v0.5.1
https://github.com/python/cpython
Revision fc521498bbaf92c2920cca026ca69424298bd9d7 authored by Ezio Melotti on 02 August 2010, 20:52:47 UTC, committed by Ezio Melotti on 02 August 2010, 20:52:47 UTC
1 parent 5ee50bb
Raw File
Tip revision: fc521498bbaf92c2920cca026ca69424298bd9d7 authored by Ezio Melotti on 02 August 2010, 20:52:47 UTC
Fix test_bool. operator.isCallable() doesn't raise a warning on 2.6.
Tip revision: fc52149
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