Staging
v0.5.1
https://github.com/python/cpython
Revision a43f2811443aae4e0e4057bda5e675b87e40d156 authored by Martin v. Löwis on 29 March 2003, 09:48:12 UTC, committed by Martin v. Löwis on 29 March 2003, 09:48:12 UTC
1 parent 4c9fefc
Raw File
Tip revision: a43f2811443aae4e0e4057bda5e675b87e40d156 authored by Martin v. Löwis on 29 March 2003, 09:48:12 UTC
Patch #707701: Expect '??' in events. Fixes #698517.
Tip revision: a43f281
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