Staging
v0.5.1
https://github.com/python/cpython
Revision 95cc3ee00cfa079751ae2bb9a8d3387053b50489 authored by Victor Stinner on 19 September 2018, 19:01:52 UTC, committed by GitHub on 19 September 2018, 19:01:52 UTC
1 parent 73c0006
Raw File
Tip revision: 95cc3ee00cfa079751ae2bb9a8d3387053b50489 authored by Victor Stinner on 19 September 2018, 19:01:52 UTC
Revert "[3.7] bpo-34589: Add -X coerce_c_locale option; C locale coercion off by default (GH-9379)" (GH-9416)
Tip revision: 95cc3ee
strdup.c
/* 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;
}
back to top