Staging
v0.5.1
https://github.com/python/cpython
Revision 7c6e470067faa954e9a0db7ae0952fbeab7c02cf authored by Raymond Hettinger on 20 December 2006, 08:23:39 UTC, committed by Raymond Hettinger on 20 December 2006, 08:23:39 UTC
1 parent ddf3da8
Raw File
Tip revision: 7c6e470067faa954e9a0db7ae0952fbeab7c02cf authored by Raymond Hettinger on 20 December 2006, 08:23:39 UTC
Bug #1590891: random.randrange don't return correct value for big number
Tip revision: 7c6e470
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