Staging
v0.5.1
Revision 0a5a5af9b6b47727c5ee3def4508dab312949075 authored by Larry Hastings on 02 August 2018, 09:18:47 UTC, committed by Larry Hastings on 02 August 2018, 09:18:47 UTC
1 parent 804d8b3
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