view Python/strdup.c @ 74558:03e61104f7a2 3.2

Issue #12922: fix the TextIOBase documentation to include a description of seek() and tell() methods.
author Antoine Pitrou <solipsis@pitrou.net>
date Sat, 21 Jan 2012 20:20:49 +0100
parents f79434ee41fa
children e7f6cef7a4cc
line wrap: on
line source

/* 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;
}