1.1 --- a/sourcemm/concommands.cpp Sat Mar 03 06:57:30 2007 +0000
1.2 +++ b/sourcemm/concommands.cpp Wed Mar 21 17:45:28 2007 +0000
1.3 @@ -185,7 +185,7 @@
1.4 return;
1.5 } else if (strcmp(command, "refresh") == 0) {
1.6 char full_path[255];
1.7 - g_SmmAPI.PathFormat(full_path, sizeof(full_path) - 1, "%s/%s", g_ModPath.c_str(), GetPluginsFile());
1.8 + g_SmmAPI.PathFormat(full_path, sizeof(full_path), "%s/%s", g_ModPath.c_str(), GetPluginsFile());
1.9
1.10 LoadPluginsFromFile(full_path);
1.11
1.12 @@ -359,7 +359,7 @@
1.13
1.14 char error[255];
1.15
1.16 - if (!g_PluginMngr.Pause(id, error, sizeof(error)-1))
1.17 + if (!g_PluginMngr.Pause(id, error, sizeof(error)))
1.18 {
1.19 CONMSG("Pause failed: %s\n", error);
1.20 return;
1.21 @@ -379,7 +379,7 @@
1.22 int id = atoi(e->Cmd_Argv(2));
1.23 char error[255];
1.24
1.25 - if (!g_PluginMngr.Unpause(id, error, sizeof(error)-1))
1.26 + if (!g_PluginMngr.Unpause(id, error, sizeof(error)))
1.27 {
1.28 CONMSG("Unpause failed: %s\n", error);
1.29 return;
1.30 @@ -407,8 +407,7 @@
1.31
1.32 if (file[0] == '/' || strcmp(&(file[1]), ":\\") == 0)
1.33 {
1.34 - g_SmmAPI.PathFormat(full_path, sizeof(full_path)-1, "%s", file);
1.35 - snprintf(full_path, sizeof(full_path)-1, "%s", file);
1.36 + g_SmmAPI.PathFormat(full_path, sizeof(full_path), "%s", file);
1.37 } else {
1.38 const char *ext = UTIL_GetExtension(file);
1.39 #if defined WIN32 || defined _WIN32
1.40 @@ -416,14 +415,14 @@
1.41 #else
1.42 ext = ext ? "" : "_i486.so";
1.43 #endif
1.44 - g_SmmAPI.PathFormat(full_path, sizeof(full_path)-1, "%s/%s%s", g_ModPath.c_str(), file, ext);
1.45 + g_SmmAPI.PathFormat(full_path, sizeof(full_path), "%s/%s%s", g_ModPath.c_str(), file, ext);
1.46 }
1.47
1.48 char error[255]={0};
1.49 bool already;
1.50 SourceMM::CPluginManager::CPlugin *pl;
1.51
1.52 - PluginId id = g_PluginMngr.Load(full_path, Pl_Console, already, error, sizeof(error)-1);
1.53 + PluginId id = g_PluginMngr.Load(full_path, Pl_Console, already, error, sizeof(error));
1.54 pl = g_PluginMngr.FindById(id);
1.55 if (!pl || id < Pl_MinId || (pl->m_Status < Pl_Paused))
1.56 {
1.57 @@ -511,8 +510,7 @@
1.58 /* first check if it's a known filename */
1.59 if (file[0] == '/' || strcmp(&(file[1]), ":\\") == 0)
1.60 {
1.61 - g_SmmAPI.PathFormat(full_path, sizeof(full_path)-1, "%s", file);
1.62 - snprintf(full_path, sizeof(full_path)-1, "%s", file);
1.63 + g_SmmAPI.PathFormat(full_path, sizeof(full_path), "%s", file);
1.64 } else {
1.65 const char *ext = UTIL_GetExtension(file);
1.66 #if defined WIN32 || defined _WIN32
1.67 @@ -520,7 +518,7 @@
1.68 #else
1.69 ext = ext ? "" : "_i486.so";
1.70 #endif
1.71 - g_SmmAPI.PathFormat(full_path, sizeof(full_path)-1, "%s/%s%s", g_ModPath.c_str(), file, ext);
1.72 + g_SmmAPI.PathFormat(full_path, sizeof(full_path), "%s/%s%s", g_ModPath.c_str(), file, ext);
1.73 }
1.74
1.75 SourceHook::List<SourceMM::CPluginManager::CPlugin *>::iterator iter, end;
1.76 @@ -543,7 +541,7 @@
1.77 }
1.78 }
1.79
1.80 - if (!g_PluginMngr.Unload(id, false, error, sizeof(error)-1))
1.81 + if (!g_PluginMngr.Unload(id, false, error, sizeof(error)))
1.82 {
1.83 CONMSG("Unload failed: %s\n", error);
1.84 return;
1.85 @@ -560,7 +558,7 @@
1.86 int id = atoi(e->Cmd_Argv(2));
1.87 char error[255]={0};
1.88
1.89 - if (!g_PluginMngr.Unload(id, false, error, sizeof(error)-1))
1.90 + if (!g_PluginMngr.Unload(id, false, error, sizeof(error)))
1.91 {
1.92 CONMSG("Force unload failed: %s\n", error);
1.93 return;
1.94 @@ -590,7 +588,7 @@
1.95 int id = atoi(e->Cmd_Argv(2));
1.96 char error[255];
1.97
1.98 - if (!g_PluginMngr.Retry(id, error, sizeof(error)-1))
1.99 + if (!g_PluginMngr.Retry(id, error, sizeof(error)))
1.100 {
1.101 CONMSG("Error reloading plugin: %s\n", error);
1.102 return;