1996-08-29 14:48:26 -03:00
|
|
|
/* strdup() replacement (from stdwin, if you must know) */
|
|
|
|
|
|
|
|
char *
|
2000-07-22 15:47:25 -03:00
|
|
|
strdup(const char *str)
|
1996-08-29 14:48:26 -03:00
|
|
|
{
|
2017-11-28 11:56:10 -04:00
|
|
|
if (str != NULL) {
|
|
|
|
char *copy = malloc(strlen(str) + 1);
|
|
|
|
if (copy != NULL)
|
|
|
|
return strcpy(copy, str);
|
|
|
|
}
|
|
|
|
return NULL;
|
1996-08-29 14:48:26 -03:00
|
|
|
}
|