Staging
v0.5.1
https://github.com/python/cpython
Revision 715ef02ddc9c9d175a324dbeddbb7a1c750238ee authored by Zachary Ware on 18 April 2014, 14:23:14 UTC, committed by Zachary Ware on 18 April 2014, 14:23:14 UTC
1 parent ea42b4c
Raw File
Tip revision: 715ef02ddc9c9d175a324dbeddbb7a1c750238ee authored by Zachary Ware on 18 April 2014, 14:23:14 UTC
Fix a typo in the docstring of nb_index.
Tip revision: 715ef02
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
	if (str != NULL) {
		char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top