Staging
v0.8.1
https://github.com/python/cpython
Revision 83325e9087e1072cd51fed09896dc92a524db781 authored by Raymond Hettinger on 16 July 2003, 04:32:32 UTC, committed by Raymond Hettinger on 16 July 2003, 04:32:32 UTC
Note, these tests were not getting exercised because
doctest skips over private functions.
1 parent f359062
Raw File
Tip revision: 83325e9087e1072cd51fed09896dc92a524db781 authored by Raymond Hettinger on 16 July 2003, 04:32:32 UTC
Fix faulty doctests. There is no results attribute.
Tip revision: 83325e9
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