From 5b82822c12e014771dceaf9d909e1c0f3653c5a9 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 23 Apr 2014 21:12:09 +0000 Subject: (svn r26486) -Codechange: replace a number of snprintfs with seprintf --- src/script/script_info.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/script/script_info.cpp') 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; } -- cgit v1.2.3-54-g00ecf