Staging
v0.8.1
Revision 3a844a2822295d0811e2d6f84f91464e35c70160 authored by Fred Drake on 06 October 2000, 21:00:40 UTC, committed by Fred Drake on 06 October 2000, 21:00:40 UTC
1 parent db810ac
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