(svn r26486) -Codechange: replace a number of snprintfs with seprintf
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user