Staging
v0.5.1
Revision a61d7f2490fd677343c28ac53e1b41cdb0e1d998 authored by Larry Hastings on 04 February 2018, 23:40:38 UTC, committed by Larry Hastings on 04 February 2018, 23:40:38 UTC
1 parent 2a5da97
Raw File
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

#include "pgenheaders.h"

char *
strdup(const char *str)
{
	if (str != NULL) {
		char *copy = malloc(strlen(str) + 1);
		if (copy != NULL)
			return strcpy(copy, str);
	}
	return NULL;
}
back to top