Staging
v0.8.1
https://github.com/python/cpython
Revision 5acc1b5f0b62eef3258e4bc31eba3b9c659108c9 authored by Miss Islington (bot) on 23 September 2020, 03:57:48 UTC, committed by GitHub on 23 September 2020, 03:57:48 UTC
(cherry picked from commit 62e40d8450b9c78346ec3617de7fe3f0ad381510)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
1 parent 2466a7a
Raw File
Tip revision: 5acc1b5f0b62eef3258e4bc31eba3b9c659108c9 authored by Miss Islington (bot) on 23 September 2020, 03:57:48 UTC
bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22369)
Tip revision: 5acc1b5
strdup.c
/* strdup() replacement (from stdwin, if you must know) */

char *
strdup(const char *str)
{
    if (str != NULL) {
        char *copy = malloc(strlen(str) + 1);
        if (copy != NULL)
            return strcpy(copy, str);
    }
    return NULL;
}
back to top