diff options
author | rubidium <rubidium@openttd.org> | 2014-04-25 15:40:32 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2014-04-25 15:40:32 +0000 |
commit | 9ed12b0f07edb342aaff21c130d325fd158a9d5b (patch) | |
tree | f42aa775396b4ebda4d119f76e80a77c180936c7 /src/script/script_scanner.cpp | |
parent | 4227f495c51ea909707505ec2ef1c730a382965d (diff) | |
download | openttd-9ed12b0f07edb342aaff21c130d325fd158a9d5b.tar.xz |
(svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL)
Diffstat (limited to 'src/script/script_scanner.cpp')
-rw-r--r-- | src/script/script_scanner.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/script_scanner.cpp b/src/script/script_scanner.cpp index 3796aafd5..98bc1f385 100644 --- a/src/script/script_scanner.cpp +++ b/src/script/script_scanner.cpp @@ -29,12 +29,12 @@ bool ScriptScanner::AddFile(const char *filename, size_t basepath_length, const char *tar_filename) { free(this->main_script); - this->main_script = strdup(filename); + this->main_script = stredup(filename); if (this->main_script == NULL) return false; free(this->tar_file); if (tar_filename != NULL) { - this->tar_file = strdup(tar_filename); + this->tar_file = stredup(tar_filename); if (this->tar_file == NULL) return false; } else { this->tar_file = NULL; @@ -150,13 +150,13 @@ void ScriptScanner::RegisterScript(ScriptInfo *info) return; } - this->info_list[strdup(script_name)] = info; + this->info_list[stredup(script_name)] = info; if (!info->IsDeveloperOnly() || _settings_client.gui.ai_developer_tools) { /* Add the script to the 'unique' script list, where only the highest version * of the script is registered. */ if (this->info_single_list.find(script_original_name) == this->info_single_list.end()) { - this->info_single_list[strdup(script_original_name)] = info; + this->info_single_list[stredup(script_original_name)] = info; } else if (this->info_single_list[script_original_name]->GetVersion() < info->GetVersion()) { this->info_single_list[script_original_name] = info; } |