(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

@@ -527,11 +527,11 @@ void NORETURN SlError(StringID string, const char *extra_msg)
if (_sl.action == SLA_LOAD_CHECK) {
_load_check_data.error = string;
free(_load_check_data.error_data);
_load_check_data.error_data = (extra_msg == NULL) ? NULL : strdup(extra_msg);
_load_check_data.error_data = (extra_msg == NULL) ? NULL : stredup(extra_msg);
} else {
_sl.error_str = string;
free(_sl.extra_msg);
_sl.extra_msg = (extra_msg == NULL) ? NULL : strdup(extra_msg);
_sl.extra_msg = (extra_msg == NULL) ? NULL : stredup(extra_msg);
}
/* We have to NULL all pointers here; we might be in a state where