Staging
v0.5.1
Revision 9f04e6a110a1bd2c72a88ba04c5d5fff2d8c39e6 authored by Martin v. Löwis on 17 August 2006, 17:27:31 UTC, committed by Martin v. Löwis on 17 August 2006, 17:27:31 UTC
1 parent e1d4fe6
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