view Python/strdup.c @ 82148:3fdcffdfd3e6

Reject float as uid or gid. A regression was introduced in the commit for issue #4591.
author Serhiy Storchaka <storchaka@gmail.com>
date Sun, 10 Feb 2013 23:28:33 +0200
parents f79434ee41fa
children e7f6cef7a4cc
line wrap: on
line source

/* 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;
}