blob: d21a0bc9ec2430e2fc743451270753d361f898ff [file] [log] [blame]
/* 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;
}