summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-04-23 21:16:58 +0000
committerrubidium <rubidium@openttd.org>2014-04-23 21:16:58 +0000
commita5274117bdc323aedc95dbecea6014a308b9a9a0 (patch)
tree65c485894dbc677cfbc5473f549312498435249b /src/script
parent5b82822c12e014771dceaf9d909e1c0f3653c5a9 (diff)
downloadopenttd-a5274117bdc323aedc95dbecea6014a308b9a9a0.tar.xz
(svn r26487) -Codechange: use lastof instead of lengthof/sizeof for script names
Diffstat (limited to 'src/script')
-rw-r--r--src/script/script_scanner.cpp2
-rw-r--r--src/script/script_scanner.hpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/script/script_scanner.cpp b/src/script/script_scanner.cpp
index 578068592..2eb056049 100644
--- a/src/script/script_scanner.cpp
+++ b/src/script/script_scanner.cpp
@@ -110,7 +110,7 @@ void ScriptScanner::Reset()
void ScriptScanner::RegisterScript(ScriptInfo *info)
{
char script_original_name[1024];
- this->GetScriptName(info, script_original_name, sizeof(script_original_name));
+ this->GetScriptName(info, script_original_name, lastof(script_original_name));
strtolower(script_original_name);
char script_name[1024];
diff --git a/src/script/script_scanner.hpp b/src/script/script_scanner.hpp
index 792d36bae..5418dbd85 100644
--- a/src/script/script_scanner.hpp
+++ b/src/script/script_scanner.hpp
@@ -101,7 +101,7 @@ protected:
/**
* Get the script name how to store the script in memory.
*/
- virtual void GetScriptName(ScriptInfo *info, char *name, int len) = 0;
+ virtual void GetScriptName(ScriptInfo *info, char *name, const char *last) = 0;
/**
* Get the filename to scan for this type of script.