You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
251 B
13 lines
251 B
4 months ago
|
/* strdup() replacement (from stdwin, if you must know) */
|
||
|
|
||
|
char *
|
||
|
strdup(const char *str)
|
||
|
{
|
||
|
if (str != NULL) {
|
||
|
char *copy = malloc(strlen(str) + 1);
|
||
|
if (copy != NULL)
|
||
|
return strcpy(copy, str);
|
||
|
}
|
||
|
return NULL;
|
||
|
}
|