Staging
v0.5.1
Revision 44719a771767b43cc0ee1d50c896179c8722a7d7 authored by Larry Hastings on 28 September 2013, 22:51:00 UTC, committed by Larry Hastings on 28 September 2013, 22:51:00 UTC
1 parent 346f402
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