source: python/vendor/current/Python/strdup.c

Last change on this file was 2, checked in by Yuri Dario, 15 years ago

Initial import for vendor code.

  • Property svn:eol-style set to native
File size: 256 bytes
Line 
1/* strdup() replacement (from stdwin, if you must know) */
2
3#include "pgenheaders.h"
4
5char *
6strdup(const char *str)
7{
8 if (str != NULL) {
9 register char *copy = malloc(strlen(str) + 1);
10 if (copy != NULL)
11 return strcpy(copy, str);
12 }
13 return NULL;
14}
Note: See TracBrowser for help on using the repository browser.