ยปCore Development>Code coverage>Python/strdup.c

Python code coverage for Python/strdup.c

#countcontent
1n/a/* strdup() replacement (from stdwin, if you must know) */
2n/a
3n/a#include "pgenheaders.h"
4n/a
5n/achar *
6n/astrdup(const char *str)
7n/a{
8n/a if (str != NULL) {
9n/a char *copy = malloc(strlen(str) + 1);
10n/a if (copy != NULL)
11n/a return strcpy(copy, str);
12n/a }
13n/a return NULL;
14n/a}