Mercurial > cpython-lru_cache-weakref
view Python/strdup.c @ 70626:aa07c1237f4e
(Merge 3.2) Issue #12016: Reindent decoders of HK and JP codecs
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Fri, 03 Jun 2011 23:34:32 +0200 |
| parents | f79434ee41fa |
| children | e7f6cef7a4cc |
line wrap: on
line source
/* strdup() replacement (from stdwin, if you must know) */ #include "pgenheaders.h" char * strdup(const char *str) { if (str != NULL) { register char *copy = malloc(strlen(str) + 1); if (copy != NULL) return strcpy(copy, str); } return NULL; }
