Staging
v0.8.1
https://github.com/python/cpython
Revision 68055ce6fe015ff07352401045e01e6e2d861f11 authored by Guido van Rossum on 11 December 1998, 14:56:38 UTC, committed by Guido van Rossum on 11 December 1998, 14:56:38 UTC
from the fast free list -- the type (at least) is reset by
_Py_Dealloc().
1 parent 21ef088
Raw File
Tip revision: 68055ce6fe015ff07352401045e01e6e2d861f11 authored by Guido van Rossum on 11 December 1998, 14:56:38 UTC
When tracing references, reset the type and size of tuples allocated
Tip revision: 68055ce
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "config.h"
#include "myproto.h"
#include "mymalloc.h"

#include <string.h>

char *
strdup(str)
	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