Staging
v0.8.1
https://github.com/python/cpython
Revision 6a66a68fe6132418ad6aba5162871f0dcd3651ad authored by cvs2svn on 18 July 2003, 17:45:33 UTC, committed by cvs2svn on 18 July 2003, 17:45:33 UTC
1 parent 6d58bf6
Raw File
Tip revision: 6a66a68fe6132418ad6aba5162871f0dcd3651ad authored by cvs2svn on 18 July 2003, 17:45:33 UTC
This commit was manufactured by cvs2svn to create tag 'r23c1'.
Tip revision: 6a66a68
strdup.c
/* 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;
}
back to top