Staging
v0.5.1
https://github.com/python/cpython
Revision e1c669b7ed18a81bfaa349726424ff5de9485f0a authored by Miss Islington (bot) on 28 November 2020, 15:02:23 UTC, committed by GitHub on 28 November 2020, 15:02:23 UTC
(cherry picked from commit d41ec65ab7411e877ca33d05e8c900feca530635)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
1 parent 4498e98
Raw File
Tip revision: e1c669b7ed18a81bfaa349726424ff5de9485f0a authored by Miss Islington (bot) on 28 November 2020, 15:02:23 UTC
bpo-42489: Fix the signature for list.sort() in the tutorial (GH-23538)
Tip revision: e1c669b
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