Staging
v0.8.1
Revision 3a4875e5e3818680adc48abfc507c2176876f22f authored by Eli Bendersky on 26 March 2012, 18:43:32 UTC, committed by Eli Bendersky on 26 March 2012, 18:43:32 UTC
samples and a reference. Also fix the other nits mentioned in the issue.

This also partially addresses issue #14006.
1 parent 70ea34d
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