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