Staging
v0.5.1
https://github.com/python/cpython
Revision 07c9d8547c39809282884bf0189d977b5e4fec4f authored by Ned Deily on 09 January 2018, 03:05:14 UTC, committed by Ned Deily on 09 January 2018, 03:05:14 UTC
1 parent 3b43bfa
Raw File
Tip revision: 07c9d8547c39809282884bf0189d977b5e4fec4f authored by Ned Deily on 09 January 2018, 03:05:14 UTC
Bump to 3.7.0a4
Tip revision: 07c9d85
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