Commit bae29713 authored by Guido van Rossum's avatar Guido van Rossum

*** empty log message ***

parent 62cf605a
/* strdup() replacement (from stdwin, if you must know) */
#include "config.h"
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#else
extern ANY *malloc Py_PROTO((size_t));
#endif
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;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment