view Python/strdup.c @ 17519:f9dfd587c142 legacy-trunk

Make one more private symbol static.
author Guido van Rossum <guido@python.org>
date Sat, 14 Apr 2001 17:55:41 +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;
}