Staging
v0.5.1
Revision 18e897250a073e22ebc5e50d59551e44d98f8338 authored by Georg Brandl on 12 October 2014, 07:03:40 UTC, committed by Georg Brandl on 12 October 2014, 07:03:40 UTC
1 parent 4cae8ff
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