(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)

This commit is contained in:
rubidium
2014-04-25 15:40:32 +00:00
parent 0b159549d4
commit 034735a54c
70 changed files with 207 additions and 183 deletions

View File

@@ -94,10 +94,10 @@ char *CopyFromOldName(StringID id)
/* Terminate the new string and copy it back to the name array */
*strto = '\0';
return strdup(tmp);
return stredup(tmp);
} else {
/* Name will already be in UTF-8. */
return strdup(&_old_name_array[LEN_OLD_STRINGS * GB(id, 0, 9)]);
return stredup(&_old_name_array[LEN_OLD_STRINGS * GB(id, 0, 9)]);
}
}