diff options
Diffstat (limited to 'Python/strdup.c')
-rw-r--r-- | Python/strdup.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Python/strdup.c b/Python/strdup.c index 6ce171b..20187e0 100644 --- a/Python/strdup.c +++ b/Python/strdup.c @@ -1,12 +1,14 @@ /* 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; + if (str != NULL) { + register char *copy = malloc(strlen(str) + 1); + if (copy != NULL) + return strcpy(copy, str); + } + return NULL; } |