Staging
v0.5.1
https://github.com/python/cpython
Raw File
Tip revision: 080daa04f1636224f2b0aeb34de80482a6d2496b authored by cvs2svn on 11 April 2000, 17:11:09 UTC
This commit was manufactured by cvs2svn to create tag 'r16a2'.
Tip revision: 080daa0
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.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