Staging
v0.5.1
https://github.com/python/cpython
Revision 292dd1b2ad51285e793f23af4157251780c9a638 authored by Serhiy Storchaka on 16 November 2016, 14:12:34 UTC, committed by Serhiy Storchaka on 16 November 2016, 14:12:34 UTC
1 parent f5894dd
Raw File
Tip revision: 292dd1b2ad51285e793f23af4157251780c9a638 authored by Serhiy Storchaka on 16 November 2016, 14:12:34 UTC
Fixed an off-by-one error in _PyUnicode_EqualToASCIIString (issue #28701).
Tip revision: 292dd1b
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