Staging
v0.5.1
Revision cbda96ec5ebc05a87e2e5751dc1af1deabdac738 authored by Benjamin Peterson on 25 October 2008, 02:56:18 UTC, committed by Benjamin Peterson on 25 October 2008, 02:56:18 UTC
........
  r67013 | benjamin.peterson | 2008-10-24 21:53:28 -0500 (Fri, 24 Oct 2008) | 1 line

  give a py3k warning when 'nonlocal' is used as a variable name
........
1 parent ce825f1
Raw File
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