Staging
v0.8.1
https://github.com/python/cpython
Revision bd2d30cf31c61843645a96a377aa0573052c4972 authored by Victor Stinner on 21 March 2013, 11:21:06 UTC, committed by Victor Stinner on 21 March 2013, 11:21:06 UTC
1 parent 6bd5202
Raw File
Tip revision: bd2d30cf31c61843645a96a377aa0573052c4972 authored by Victor Stinner on 21 March 2013, 11:21:06 UTC
Issue #17209: curses.window.get_wch() now handles correctly KeyboardInterrupt (CTRL+c)
Tip revision: bd2d30c
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