view Python/strdup.c @ 34161:ca2ca1aeb080 2.4

Check in missing png version of pyfav.gif.
author Johannes Gijsbers <jlg@dds.nl>
date Mon, 13 Dec 2004 13:11:42 +0000
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;
}