Staging
v0.5.1
https://github.com/python/cpython
Revision 7491d2a23a01842cc5b2f62de33a30ee791f68bd authored by Neal Norwitz on 28 March 2006, 06:19:28 UTC, committed by Neal Norwitz on 28 March 2006, 06:19:28 UTC
1 parent d03b073
Raw File
Tip revision: 7491d2a23a01842cc5b2f62de33a30ee791f68bd authored by Neal Norwitz on 28 March 2006, 06:19:28 UTC
Try to get rid of a Coverity warning by consistently using origpending.
Tip revision: 7491d2a
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