Mercurial > cpython-lru_cache-weakref
view Python/strdup.c @ 78335:fd5166fdb978 3.2
Issue #12288: Consider '0' and '0.0' as valid initialvalue for tkinter SimpleDialog.
| author | Andrew Svetlov <andrew.svetlov@gmail.com> |
|---|---|
| date | Mon, 30 Jul 2012 19:59:53 +0300 |
| 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; }
