summaryrefslogtreecommitdiff
path: root/src/script/script_info.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-04-23 21:12:09 +0000
committerrubidium <rubidium@openttd.org>2014-04-23 21:12:09 +0000
commit5b82822c12e014771dceaf9d909e1c0f3653c5a9 (patch)
tree1cf02e076eb61eb94d9064c7cb02bbe85ecb9a6c /src/script/script_info.cpp
parentef4c2ce0317ae583e837722b6a41ea44cd83da71 (diff)
downloadopenttd-5b82822c12e014771dceaf9d909e1c0f3653c5a9.tar.xz
(svn r26486) -Codechange: replace a number of snprintfs with seprintf
Diffstat (limited to 'src/script/script_info.cpp')
-rw-r--r--src/script/script_info.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/script/script_info.cpp b/src/script/script_info.cpp
index f3ea1747b..27bcec1eb 100644
--- a/src/script/script_info.cpp
+++ b/src/script/script_info.cpp
@@ -50,7 +50,7 @@ bool ScriptInfo::CheckMethod(const char *name) const
{
if (!this->engine->MethodExists(*this->SQ_instance, name)) {
char error[1024];
- snprintf(error, sizeof(error), "your info.nut/library.nut doesn't have the method '%s'", name);
+ seprintf(error, lastof(error), "your info.nut/library.nut doesn't have the method '%s'", name);
this->engine->ThrowError(error);
return false;
}
@@ -195,7 +195,7 @@ SQInteger ScriptInfo::AddSetting(HSQUIRRELVM vm)
items |= 0x100;
} else {
char error[1024];
- snprintf(error, sizeof(error), "unknown setting property '%s'", key);
+ seprintf(error, lastof(error), "unknown setting property '%s'", key);
this->engine->ThrowError(error);
return SQ_ERROR;
}
@@ -208,7 +208,7 @@ SQInteger ScriptInfo::AddSetting(HSQUIRRELVM vm)
* be set for the same config item. */
if ((items & 0x200) != 0 && (config.flags & SCRIPTCONFIG_RANDOM) != 0) {
char error[1024];
- snprintf(error, sizeof(error), "Setting both random_deviation and SCRIPTCONFIG_RANDOM is not allowed");
+ seprintf(error, lastof(error), "Setting both random_deviation and SCRIPTCONFIG_RANDOM is not allowed");
this->engine->ThrowError(error);
return SQ_ERROR;
}
@@ -219,7 +219,7 @@ SQInteger ScriptInfo::AddSetting(HSQUIRRELVM vm)
uint mask = (config.flags & SCRIPTCONFIG_BOOLEAN) ? 0x1F3 : 0x1FF;
if (items != mask) {
char error[1024];
- snprintf(error, sizeof(error), "please define all properties of a setting (min/max not allowed for booleans)");
+ seprintf(error, lastof(error), "please define all properties of a setting (min/max not allowed for booleans)");
this->engine->ThrowError(error);
return SQ_ERROR;
}
@@ -242,7 +242,7 @@ SQInteger ScriptInfo::AddLabels(HSQUIRRELVM vm)
if (config == NULL) {
char error[1024];
- snprintf(error, sizeof(error), "Trying to add labels for non-defined setting '%s'", setting_name);
+ seprintf(error, lastof(error), "Trying to add labels for non-defined setting '%s'", setting_name);
this->engine->ThrowError(error);
return SQ_ERROR;
}