diff options
author | Michael Lutz <michi@icosahedron.de> | 2020-12-06 21:11:50 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2020-12-27 13:19:25 +0100 |
commit | b408fe77f792650ef569f9852165759f960fd52f (patch) | |
tree | 6d1f0a134da31bd1d53dee052721d78955d688e6 /src/script/script_info.cpp | |
parent | 358056ec428d1938b8c9219a60c6fb400115f152 (diff) | |
download | openttd-b408fe77f792650ef569f9852165759f960fd52f.tar.xz |
Codechange: Use std::string in file scanners.
Diffstat (limited to 'src/script/script_info.cpp')
-rw-r--r-- | src/script/script_info.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/script/script_info.cpp b/src/script/script_info.cpp index 4eebd548d..d02bbe324 100644 --- a/src/script/script_info.cpp +++ b/src/script/script_info.cpp @@ -39,8 +39,6 @@ ScriptInfo::~ScriptInfo() free(this->date); free(this->instance_name); free(this->url); - free(this->main_script); - free(this->tar_file); free(this->SQ_instance); } @@ -81,9 +79,8 @@ bool ScriptInfo::CheckMethod(const char *name) const } /* Get location information of the scanner */ - info->main_script = stredup(info->scanner->GetMainScript()); - const char *tar_name = info->scanner->GetTarFile(); - if (tar_name != nullptr) info->tar_file = stredup(tar_name); + info->main_script = info->scanner->GetMainScript(); + info->tar_file = info->scanner->GetTarFile(); /* Cache the data the info file gives us. */ if (!info->engine->CallStringMethodStrdup(*info->SQ_instance, "GetAuthor", &info->author, MAX_GET_OPS)) return SQ_ERROR; |