Mercurial > cpython-lru_cache-weakref
view Python/strdup.c @ 6719:faebc1940432 legacy-trunk
Understand -Xlinker option.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 02 Dec 1997 20:38:11 +0000 |
| parents | bb5b9ff72de1 |
| children | 8efa37a770c6 |
line wrap: on
line source
/* strdup() replacement (from stdwin, if you must know) */ #include "config.h" #include "myproto.h" #include "mymalloc.h" #include <string.h> char * strdup(str) const char *str; { if (str != NULL) { register char *copy = malloc(strlen(str) + 1); if (copy != NULL) return strcpy(copy, str); } return NULL; }
