From 484b6978fb784f40bc353ee9c905e4e847d1a597 Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Sat, 2 Apr 2016 13:13:32 +0300 Subject: [PATCH] Minor changes in modules and host plugin. --- modules/sqlite/Common.cpp | 2 +- modules/sqlite/Module.cpp | 2 +- modules/xml/Module.cpp | 2 +- source/Command.cpp | 4 +++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/sqlite/Common.cpp b/modules/sqlite/Common.cpp index 0b120326..bc2b6281 100644 --- a/modules/sqlite/Common.cpp +++ b/modules/sqlite/Common.cpp @@ -55,7 +55,7 @@ CSStr FmtStr(CSStr str, ...) // Write the requested contents if (std::vsnprintf(g_Buffer, sizeof(g_Buffer), str, args) < 0) { - g_Buffer[0] = 0; // make sure the string is terminated + g_Buffer[0] = 0; // Make sure the string is terminated } // Release the argument list va_end(args); diff --git a/modules/sqlite/Module.cpp b/modules/sqlite/Module.cpp index 99c625d5..07b61bd0 100644 --- a/modules/sqlite/Module.cpp +++ b/modules/sqlite/Module.cpp @@ -825,7 +825,7 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs* functions, PluginCallb _Info = info; // Assign plugin information _Info->uPluginVer = SQSQLITE_VERSION; - strcpy(_Info->szName, SQSQLITE_HOST_NAME); + std::strcpy(_Info->szName, SQSQLITE_HOST_NAME); // Bind callbacks BindCallbacks(); // Notify that the plugin was successfully loaded diff --git a/modules/xml/Module.cpp b/modules/xml/Module.cpp index 4da24b71..aefbb687 100644 --- a/modules/xml/Module.cpp +++ b/modules/xml/Module.cpp @@ -595,7 +595,7 @@ SQMOD_API_EXPORT unsigned int VcmpPluginInit(PluginFuncs* functions, PluginCallb _Info = info; // Assign plugin information _Info->uPluginVer = SQXML_VERSION; - strcpy(_Info->szName, SQXML_HOST_NAME); + std::strcpy(_Info->szName, SQXML_HOST_NAME); // Bind callbacks BindCallbacks(); // Notify that the plugin was successfully loaded diff --git a/source/Command.cpp b/source/Command.cpp index 22ee52de..078791b1 100644 --- a/source/Command.cpp +++ b/source/Command.cpp @@ -550,8 +550,10 @@ bool CmdManager::Parse() // Extract the current characters before advancing prev = elem, elem = *itr; // See if there's anything left to parse - if (elem == 0) + if (elem == '\0') + { break; + } // Early check to prevent parsing extraneous arguments else if (m_Argc >= max_arg) {