diff --git a/amxmodx/CLibrarySys.cpp b/amxmodx/CLibrarySys.cpp index b20b965f..75bb5ac6 100644 --- a/amxmodx/CLibrarySys.cpp +++ b/amxmodx/CLibrarySys.cpp @@ -24,7 +24,7 @@ CDirectory::CDirectory(const char *path) #if defined PLATFORM_WINDOWS char newpath[PLATFORM_MAX_PATH]; - UTIL_Format(newpath, sizeof(newpath) - 1, "%s\\*.*", path); + ke::SafeSprintf(newpath, sizeof(newpath) - 1, "%s\\*.*", path); m_dir = FindFirstFile(newpath, &m_fd); @@ -40,7 +40,7 @@ CDirectory::CDirectory(const char *path) if (IsValid()) { m_ep = readdir(m_dir); // TODO: we need to read past "." and ".."! - UTIL_Format(m_origpath, sizeof(m_origpath) - 1, "%s", path); + ke::SafeSprintf(m_origpath, sizeof(m_origpath) - 1, "%s", path); } else { @@ -103,7 +103,7 @@ bool CDirectory::IsEntryDirectory() #elif defined PLATFORM_POSIX char temppath[PLATFORM_MAX_PATH]; - UTIL_Format(temppath, sizeof(temppath), "%s/%s", m_origpath, GetEntryName()); + ke::SafeSprintf(temppath, sizeof(temppath), "%s/%s", m_origpath, GetEntryName()); return ke::file::IsDirectory(temppath); @@ -119,7 +119,7 @@ bool CDirectory::IsEntryFile() #elif defined PLATFORM_POSIX char temppath[PLATFORM_MAX_PATH]; - UTIL_Format(temppath, sizeof(temppath), "%s/%s", m_origpath, GetEntryName()); + ke::SafeSprintf(temppath, sizeof(temppath), "%s/%s", m_origpath, GetEntryName()); return ke::file::IsDirectory(temppath); @@ -318,12 +318,12 @@ size_t LibrarySystem::GetFileFromPath(char* buffer, size_t maxlength, const char #endif ) { - return UTIL_Format(buffer, maxlength, "%s", &path[i + 1]); + return ke::SafeSprintf(buffer, maxlength, "%s", &path[i + 1]); } } /* We scanned and found no path separator */ - return UTIL_Format(buffer, maxlength, "%s", path); + return ke::SafeSprintf(buffer, maxlength, "%s", path); } bool LibrarySystem::FileTime(const char* path, FileTimeType type, time_t* pTime) diff --git a/amxmodx/CLibrarySys.h b/amxmodx/CLibrarySys.h index a7ef5fb5..ae919f9b 100644 --- a/amxmodx/CLibrarySys.h +++ b/amxmodx/CLibrarySys.h @@ -67,15 +67,9 @@ #define PLATFORM_MAX_PATH 260 #if defined PLATFORM_WINDOWS - - typedef HMODULE LibraryHandle; typedef HANDLE DirHandle; - #elif defined PLATFORM_POSIX - - typedef void* LibraryHandle; typedef DIR* DirHandle; - #endif enum FileTimeType diff --git a/amxmodx/CTextParsers.cpp b/amxmodx/CTextParsers.cpp index 3d508899..8d384834 100644 --- a/amxmodx/CTextParsers.cpp +++ b/amxmodx/CTextParsers.cpp @@ -137,7 +137,7 @@ SMCError TextParsers::ParseSMCFile(const char *file, states->col = 0; } /*libsys->GetPlatformError(error, sizeof(error));*/ - UTIL_Format(buffer, maxsize, "File could not be opened: %s", error); + ke::SafeSprintf(buffer, maxsize, "File could not be opened: %s", error); return SMCError_StreamOpen; } @@ -146,7 +146,7 @@ SMCError TextParsers::ParseSMCFile(const char *file, fclose(fp); errstr = GetSMCErrorString(result); - UTIL_Format(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error"); + ke::SafeSprintf(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error"); return result; } @@ -197,7 +197,7 @@ SMCError TextParsers::ParseSMCStream(const char *stream, result = ParseStream_SMC(&rs, RawStreamReader, smc_listener, states); const char *errstr = GetSMCErrorString(result); - UTIL_Format(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error"); + ke::SafeSprintf(buffer, maxsize, "%s", errstr != NULL ? errstr : "Unknown error"); return result; } diff --git a/amxmodx/CoreConfig.cpp b/amxmodx/CoreConfig.cpp index 564e6b83..8c9fe9a1 100644 --- a/amxmodx/CoreConfig.cpp +++ b/amxmodx/CoreConfig.cpp @@ -53,8 +53,8 @@ void CoreConfig::ExecuteMainConfig() char path[PLATFORM_MAX_PATH]; char command[PLATFORM_MAX_PATH + sizeof(CommandFormat)]; - UTIL_Format(path, sizeof(path), "%s/%s/%s", g_mod_name.chars(), get_localinfo("amx_configdir", "addons/amxmodx/configs"), MainConfigFile); - UTIL_Format(command, sizeof(command), CommandFormat, path); + ke::SafeSprintf(path, sizeof(path), "%s/%s/%s", g_mod_name.chars(), get_localinfo("amx_configdir", "addons/amxmodx/configs"), MainConfigFile); + ke::SafeSprintf(command, sizeof(command), CommandFormat, path); SERVER_COMMAND(command); } @@ -140,11 +140,11 @@ bool CoreConfig::ExecuteAutoConfig(CPluginMngr::CPlugin *plugin, AutoConfig *con if (config->folder.length()) { - UTIL_Format(file, sizeof(file), "%s/%s%s/%s/%s.cfg", g_mod_name.chars(), configsDir, AutoConfigDir, config->folder.chars(), config->autocfg.chars()); + ke::SafeSprintf(file, sizeof(file), "%s/%s%s/%s/%s.cfg", g_mod_name.chars(), configsDir, AutoConfigDir, config->folder.chars(), config->autocfg.chars()); } else { - UTIL_Format(file, sizeof(file), "%s/%s%s/%s.cfg", g_mod_name.chars(), configsDir, AutoConfigDir, config->autocfg.chars()); + ke::SafeSprintf(file, sizeof(file), "%s/%s%s/%s.cfg", g_mod_name.chars(), configsDir, AutoConfigDir, config->autocfg.chars()); } bool file_exists = g_LibSys.IsPathFile(file); @@ -244,7 +244,7 @@ bool CoreConfig::ExecuteAutoConfig(CPluginMngr::CPlugin *plugin, AutoConfig *con if (file_exists) { char command[PLATFORM_MAX_PATH + sizeof(CommandFormat)]; - UTIL_Format(command, sizeof(command), CommandFormat, file); + ke::SafeSprintf(command, sizeof(command), CommandFormat, file); SERVER_COMMAND(command); } @@ -266,21 +266,21 @@ void CoreConfig::ExecuteMapConfig() if ((mapPrefix = strtok(mapName, "_"))) { - UTIL_Format(cfgPath, sizeof(cfgPath), "%s/%s%s/prefix_%s.cfg", g_mod_name.chars(), configsDir, MapConfigDir, mapPrefix); + ke::SafeSprintf(cfgPath, sizeof(cfgPath), "%s/%s%s/prefix_%s.cfg", g_mod_name.chars(), configsDir, MapConfigDir, mapPrefix); if (g_LibSys.IsPathFile(cfgPath)) { - UTIL_Format(command, sizeof(command), CommandFormat, cfgPath); + ke::SafeSprintf(command, sizeof(command), CommandFormat, cfgPath); SERVER_COMMAND(command); } } strncopy(mapName, STRING(gpGlobals->mapname), sizeof(mapName)); - UTIL_Format(cfgPath, sizeof(cfgPath), "%s/%s%s/%s.cfg", g_mod_name.chars(), configsDir, MapConfigDir, mapName); + ke::SafeSprintf(cfgPath, sizeof(cfgPath), "%s/%s%s/%s.cfg", g_mod_name.chars(), configsDir, MapConfigDir, mapName); if (g_LibSys.IsPathFile(cfgPath)) { - UTIL_Format(command, sizeof(command), CommandFormat, cfgPath); + ke::SafeSprintf(command, sizeof(command), CommandFormat, cfgPath); SERVER_COMMAND(command); } diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index 5f5213ec..64fec1ef 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -4506,7 +4506,7 @@ static cell AMX_NATIVE_CALL AutoExecConfig(AMX *amx, cell *params) } static char newName[PLATFORM_MAX_PATH]; - UTIL_Format(newName, sizeof(newName), "plugin-%s", pluginName); + ke::SafeSprintf(newName, sizeof(newName), "plugin-%s", pluginName); name = newName; } diff --git a/amxmodx/amxmodx.h b/amxmodx/amxmodx.h index 1ba87c6a..c07d2367 100755 --- a/amxmodx/amxmodx.h +++ b/amxmodx/amxmodx.h @@ -139,8 +139,6 @@ template unsigned int strncopy(D *dest, const S *src, s unsigned int UTIL_GetUTF8CharBytes(const char *stream); unsigned int UTIL_ReplaceAll(char *subject, size_t maxlength, const char *search, const char *replace, bool caseSensitive); char *UTIL_ReplaceEx(char *subject, size_t maxLen, const char *search, size_t searchLen, const char *replace, size_t replaceLen, bool caseSensitive); -char *UTIL_VarArgs(const char *fmt, ...); -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); void UTIL_TrimLeft(char *buffer); void UTIL_TrimRight(char *buffer); diff --git a/amxmodx/amxxlog.cpp b/amxmodx/amxxlog.cpp index fa576a8f..1611ef56 100755 --- a/amxmodx/amxxlog.cpp +++ b/amxmodx/amxxlog.cpp @@ -81,7 +81,7 @@ void CLog::CreateNewFile() while (true) { - UTIL_Format(name, sizeof(name), "%s/L%02d%02d%03d.log", g_log_dir.chars(), curTime->tm_mon + 1, curTime->tm_mday, i); + ke::SafeSprintf(name, sizeof(name), "%s/L%02d%02d%03d.log", g_log_dir.chars(), curTime->tm_mon + 1, curTime->tm_mday, i); build_pathname_r(file, sizeof(file)-1, "%s", name); FILE *pTmpFile = fopen(file, "r"); // open for reading to check whether the file exists @@ -243,7 +243,7 @@ void CLog::LogError(const char *fmt, ...) va_end(arglst); FILE *pF = NULL; - UTIL_Format(name, sizeof(name), "%s/error_%04d%02d%02d.log", g_log_dir.chars(), curTime->tm_year + 1900, curTime->tm_mon + 1, curTime->tm_mday); + ke::SafeSprintf(name, sizeof(name), "%s/error_%04d%02d%02d.log", g_log_dir.chars(), curTime->tm_year + 1900, curTime->tm_mon + 1, curTime->tm_mday); build_pathname_r(file, sizeof(file)-1, "%s", name); pF = fopen(file, "a+"); diff --git a/amxmodx/cvars.cpp b/amxmodx/cvars.cpp index 9c497065..c7319bf1 100644 --- a/amxmodx/cvars.cpp +++ b/amxmodx/cvars.cpp @@ -240,7 +240,7 @@ static cell AMX_NATIVE_CALL set_cvar_float(AMX *amx, cell *params) if (info) { - UTIL_Format(CVarTempBuffer, sizeof(CVarTempBuffer) - 1, "%f", amx_ctof(params[2])); + ke::SafeSprintf(CVarTempBuffer, sizeof(CVarTempBuffer) - 1, "%f", amx_ctof(params[2])); CVAR_DIRECTSET(info->var, &CVarTempBuffer[0]); } @@ -258,7 +258,7 @@ static cell AMX_NATIVE_CALL set_cvar_num(AMX *amx, cell *params) if (info) { - UTIL_Format(CVarTempBuffer, sizeof(CVarTempBuffer) - 1, "%d", value); + ke::SafeSprintf(CVarTempBuffer, sizeof(CVarTempBuffer) - 1, "%d", value); CVAR_DIRECTSET(info->var, &CVarTempBuffer[0]); } @@ -444,7 +444,7 @@ static cell AMX_NATIVE_CALL set_pcvar_float(AMX *amx, cell *params) return 0; } - UTIL_Format(CVarTempBuffer, sizeof(CVarTempBuffer) - 1, "%f", amx_ctof(params[2])); + ke::SafeSprintf(CVarTempBuffer, sizeof(CVarTempBuffer) - 1, "%f", amx_ctof(params[2])); CVAR_DIRECTSET(ptr, &CVarTempBuffer[0]); return 1; @@ -460,7 +460,7 @@ static cell AMX_NATIVE_CALL set_pcvar_num(AMX *amx, cell *params) return 0; } - UTIL_Format(CVarTempBuffer, sizeof(CVarTempBuffer) - 1, "%d", params[2]); + ke::SafeSprintf(CVarTempBuffer, sizeof(CVarTempBuffer) - 1, "%d", params[2]); CVAR_DIRECTSET(ptr, &CVarTempBuffer[0]); return 1; diff --git a/amxmodx/debugger.cpp b/amxmodx/debugger.cpp index f05eecad..a5406f0c 100755 --- a/amxmodx/debugger.cpp +++ b/amxmodx/debugger.cpp @@ -367,7 +367,7 @@ int Debugger::FormatError(char *buffer, size_t maxLength) //cell *p_cip = NULL; //int amx_err = AMX_ERR_NONE; - size += UTIL_Format(buffer, maxLength, "Run time error %d: %s ", error, gen_err); + size += ke::SafeSprintf(buffer, maxLength, "Run time error %d: %s ", error, gen_err); buffer += size; maxLength -= size; @@ -390,7 +390,7 @@ int Debugger::FormatError(char *buffer, size_t maxLength) else amx_err = AMX_ERR_NOTFOUND;*/ //if (!amx_err) - size += UTIL_Format(buffer, maxLength, "(native \"%s\")", native_name); + size += ke::SafeSprintf(buffer, maxLength, "(native \"%s\")", native_name); } return size; @@ -623,12 +623,12 @@ void Debugger::FmtGenericMsg(AMX *amx, int error, char buffer[], size_t maxLengt if (error == AMX_ERR_EXIT) { - UTIL_Format(buffer, maxLength, "Run time error %d (plugin \"%s\") - %s", error, filename, GenericError(AMX_ERR_EXIT)); + ke::SafeSprintf(buffer, maxLength, "Run time error %d (plugin \"%s\") - %s", error, filename, GenericError(AMX_ERR_EXIT)); } else if (error == AMX_ERR_NATIVE) { amx_GetNative(amx, reinterpret_cast(amx->usertags[UT_NATIVE]), native); - UTIL_Format(buffer, maxLength, "Run time error %d (plugin \"%s\") (native \"%s\") - debug not enabled!", error, filename, native); + ke::SafeSprintf(buffer, maxLength, "Run time error %d (plugin \"%s\") (native \"%s\") - debug not enabled!", error, filename, native); } else { - UTIL_Format(buffer, maxLength, "Run time error %d (plugin \"%s\") - debug not enabled!", error, filename); + ke::SafeSprintf(buffer, maxLength, "Run time error %d (plugin \"%s\") - debug not enabled!", error, filename); } } diff --git a/amxmodx/format.cpp b/amxmodx/format.cpp index 9f3e9ed0..1dc43e4e 100644 --- a/amxmodx/format.cpp +++ b/amxmodx/format.cpp @@ -673,7 +673,7 @@ reswitch: if (!def) { static char buf[255]; - UTIL_Format(buf, sizeof(buf) - 1, "ML_NOTFOUND: %s", key); + ke::SafeSprintf(buf, sizeof(buf) - 1, "ML_NOTFOUND: %s", key); def = buf; } size_t written = atcprintf(buf_p, llen, def, amx, params, &arg); @@ -708,11 +708,11 @@ reswitch: } int userid = GETPLAYERUSERID(player->pEdict); - UTIL_Format(buffer, sizeof(buffer), "%s<%d><%s><%s>", player->name.chars(), userid, auth, player->team.chars()); + ke::SafeSprintf(buffer, sizeof(buffer), "%s<%d><%s><%s>", player->name.chars(), userid, auth, player->team.chars()); } else { - UTIL_Format(buffer, sizeof(buffer), "Console<0>"); + ke::SafeSprintf(buffer, sizeof(buffer), "Console<0>"); } AddString(&buf_p, llen, buffer, width, prec); diff --git a/amxmodx/libraries.cpp b/amxmodx/libraries.cpp index 9af77a00..5e6211b8 100644 --- a/amxmodx/libraries.cpp +++ b/amxmodx/libraries.cpp @@ -97,7 +97,7 @@ size_t AddLibrariesFromString(const char *name, LibType type, LibSource src, voi char *ptr, *p, s; size_t count = 0; - UTIL_Format(buffer, sizeof(buffer)-1, "%s", name); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "%s", name); ptr = buffer; p = buffer; diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index 137c40a2..bdcbf2d5 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -226,7 +226,7 @@ void LoadExtraPluginsToPCALM(const char *initialdir) while (!files.empty()) { ke::AString *pString = files.front(); - UTIL_Format(path, sizeof(path)-1, "%s/%s", + ke::SafeSprintf(path, sizeof(path)-1, "%s/%s", initialdir, pString->chars()); g_plugins.CALMFromFile(path); @@ -243,7 +243,7 @@ void LoadExtraPluginsFromDir(const char *initialdir) while (!files.empty()) { ke::AString *pString = files.front(); - UTIL_Format(path, sizeof(path)-1, "%s/%s", + ke::SafeSprintf(path, sizeof(path)-1, "%s/%s", initialdir, pString->chars()); g_plugins.loadPluginsFromFile(path); @@ -332,7 +332,7 @@ const char* get_localinfo_r(const char *name, const char *def, char buffer[], si SET_LOCALINFO((char*)name, (char*)(b = def)); } - UTIL_Format(buffer, maxlength, "%s", b); + ke::SafeSprintf(buffer, maxlength, "%s", b); return buffer; } @@ -425,7 +425,7 @@ int C_Spawn(edict_t *pent) LoadExtraPluginsToPCALM(configs_dir); char temporaryMap[64], *tmap_ptr; - UTIL_Format(temporaryMap, sizeof(temporaryMap), "%s", STRING(gpGlobals->mapname)); + ke::SafeSprintf(temporaryMap, sizeof(temporaryMap), "%s", STRING(gpGlobals->mapname)); prefixed_map_pluginsfile[0] = '\0'; if ((tmap_ptr = strchr(temporaryMap, '_')) != NULL) @@ -433,7 +433,7 @@ int C_Spawn(edict_t *pent) // this map has a prefix *tmap_ptr = '\0'; - UTIL_Format(prefixed_map_pluginsfile, + ke::SafeSprintf(prefixed_map_pluginsfile, sizeof(prefixed_map_pluginsfile), "%s/maps/plugins-%s.ini", configs_dir, @@ -441,7 +441,7 @@ int C_Spawn(edict_t *pent) g_plugins.CALMFromFile(prefixed_map_pluginsfile); } - UTIL_Format(map_pluginsfile_path, + ke::SafeSprintf(map_pluginsfile_path, sizeof(map_pluginsfile_path), "%s/maps/plugins-%s.ini", configs_dir, diff --git a/amxmodx/modules.cpp b/amxmodx/modules.cpp index fd47eac2..f4bcf4a1 100755 --- a/amxmodx/modules.cpp +++ b/amxmodx/modules.cpp @@ -670,7 +670,7 @@ char* build_pathname(const char *fmt, ...) { static char string[256]; int b; - int a = b = UTIL_Format(string, 255, "%s%c", g_mod_name.chars(), PATH_SEP_CHAR); + int a = b = ke::SafeSprintf(string, 255, "%s%c", g_mod_name.chars(), PATH_SEP_CHAR); va_list argptr; va_start(argptr, fmt); @@ -694,7 +694,7 @@ char* build_pathname(const char *fmt, ...) char *build_pathname_r(char *buffer, size_t maxlen, const char *fmt, ...) { - UTIL_Format(buffer, maxlen, "%s%c", g_mod_name.chars(), PATH_SEP_CHAR); + ke::SafeSprintf(buffer, maxlen, "%s%c", g_mod_name.chars(), PATH_SEP_CHAR); size_t len = strlen(buffer); char *ptr = buffer + len; @@ -817,16 +817,16 @@ bool ConvertModuleName(const char *pathString, char *path) *ptr = '\0'; } - size_t length = UTIL_Format(path, PLATFORM_MAX_PATH, "%s%c%s_amxx", orig_path, PATH_SEP_CHAR, tmpname); + size_t length = ke::SafeSprintf(path, PLATFORM_MAX_PATH, "%s%c%s_amxx", orig_path, PATH_SEP_CHAR, tmpname); #if defined PLATFORM_LINUX # if defined AMD64 || PAWN_CELL_SIZE == 64 length += strncopy(path + length, "_amd64", PLATFORM_MAX_PATH - length); # else - length += UTIL_Format(path + length, PLATFORM_MAX_PATH - length, "_i%c86", iDigit); + length += ke::SafeSprintf(path + length, PLATFORM_MAX_PATH - length, "_i%c86", iDigit); # endif #endif - UTIL_Format(path + length, PLATFORM_MAX_PATH - length, ".%s", PLATFORM_LIB_EXT); + ke::SafeSprintf(path + length, PLATFORM_MAX_PATH - length, ".%s", PLATFORM_LIB_EXT); return true; } diff --git a/amxmodx/msvc12/ipch/WINCSX-7d4a1d4a/WINCSX-e0702fa2.ipch b/amxmodx/msvc12/ipch/WINCSX-7d4a1d4a/WINCSX-e0702fa2.ipch new file mode 100644 index 00000000..6d0b20bb Binary files /dev/null and b/amxmodx/msvc12/ipch/WINCSX-7d4a1d4a/WINCSX-e0702fa2.ipch differ diff --git a/amxmodx/natives.cpp b/amxmodx/natives.cpp index 87018695..1604dde7 100755 --- a/amxmodx/natives.cpp +++ b/amxmodx/natives.cpp @@ -180,7 +180,7 @@ static cell AMX_NATIVE_CALL log_error(AMX *amx, cell *params) int len; char *err = format_amxstring(amx, params, 2, len); - UTIL_Format(g_errorStr, sizeof(g_errorStr), "%s", err); + ke::SafeSprintf(g_errorStr, sizeof(g_errorStr), "%s", err); g_CurError = params[1]; return 1; diff --git a/amxmodx/newmenus.cpp b/amxmodx/newmenus.cpp index e8e1e52f..75e90b08 100755 --- a/amxmodx/newmenus.cpp +++ b/amxmodx/newmenus.cpp @@ -289,7 +289,7 @@ bool Menu::Display(int player, page_t page) return false; static char buffer[2048]; - int len = UTIL_Format(buffer, sizeof(buffer)-1, "%s", str); + int len = ke::SafeSprintf(buffer, sizeof(buffer)-1, "%s", str); CPlayer *pPlayer = GET_PLAYER_POINTER_I(player); @@ -342,14 +342,14 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) if (items_per_page && (pages != 1)) { if (m_AutoColors) - UTIL_Format(buffer, sizeof(buffer)-1, "\\y%s %d/%d\n\\w\n", m_Title.chars(), page + 1, pages); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "\\y%s %d/%d\n\\w\n", m_Title.chars(), page + 1, pages); else - UTIL_Format(buffer, sizeof(buffer)-1, "%s %d/%d\n\n", m_Title.chars(), page + 1, pages); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "%s %d/%d\n\n", m_Title.chars(), page + 1, pages); } else { if (m_AutoColors) - UTIL_Format(buffer, sizeof(buffer)-1, "\\y%s\n\\w\n", m_Title.chars()); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "\\y%s\n\\w\n", m_Title.chars()); else - UTIL_Format(buffer, sizeof(buffer)-1, "%s\n\n", m_Title.chars()); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "%s\n\n", m_Title.chars()); } m_Text = m_Text + buffer; @@ -446,22 +446,22 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) if (pItem->isBlank) { - UTIL_Format(buffer, sizeof(buffer)-1, "%s\n", pItem->name.chars()); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "%s\n", pItem->name.chars()); } else if (enabled) { if (m_AutoColors) { - UTIL_Format(buffer, sizeof(buffer)-1, "%s%d.\\w %s\n", m_ItemColor.chars(),option_display, pItem->name.chars()); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "%s%d.\\w %s\n", m_ItemColor.chars(),option_display, pItem->name.chars()); } else { - UTIL_Format(buffer, sizeof(buffer)-1, "%d. %s\n", option_display, pItem->name.chars()); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "%d. %s\n", option_display, pItem->name.chars()); } } else { if (m_AutoColors) { - UTIL_Format(buffer, sizeof(buffer)-1, "\\d%d. %s\n\\w", option_display, pItem->name.chars()); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "\\d%d. %s\n\\w", option_display, pItem->name.chars()); } else { - UTIL_Format(buffer, sizeof(buffer)-1, "#. %s\n", pItem->name.chars()); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "#. %s\n", pItem->name.chars()); } } slots++; @@ -503,14 +503,14 @@ const char *Menu::GetTextString(int player, page_t page, int &keys) keys |= (1< #include "amxmodx.h" -#if ( defined(__linux__) || defined(__APPLE__) ) && !defined _vsnprintf - #define _vsnprintf vsnprintf -#endif - -char *UTIL_VarArgs(const char *fmt, ...) -{ - va_list ap; - static char string[4096]; - - va_start(ap, fmt); - ke::SafeVsprintf(string, sizeof(string), fmt, ap); - va_end(ap); - - return string; -} - int UTIL_ReadFlags(const char* c) { int flags = 0; @@ -351,8 +335,8 @@ void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1, g_fakecmd.argv[1] = arg1; g_fakecmd.argv[2] = arg2; // build argument line - UTIL_Format(g_fakecmd.args, 255, "%s %s", arg1, arg2); - // if UTIL_Format reached 255 chars limit, this will make sure there will be no access violation + ke::SafeSprintf(g_fakecmd.args, 255, "%s %s", arg1, arg2); + // if ke::SafeSprintf reached 255 chars limit, this will make sure there will be no access violation g_fakecmd.args[255] = 0; } else if (arg1) @@ -361,8 +345,8 @@ void UTIL_FakeClientCommand(edict_t *pEdict, const char *cmd, const char *arg1, // store argument g_fakecmd.argv[1] = arg1; // build argument line - UTIL_Format(g_fakecmd.args, 255, "%s", arg1); - // if UTIL_Format reached 255 chars limit, this will make sure there will be no access violation + ke::SafeSprintf(g_fakecmd.args, 255, "%s", arg1); + // if ke::SafeSprintf reached 255 chars limit, this will make sure there will be no access violation g_fakecmd.args[255] = 0; } else @@ -694,16 +678,6 @@ char *UTIL_ReplaceEx(char *subject, size_t maxLen, const char *search, size_t se return NULL; } -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = ke::SafeVsprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - return len; -} - // From Metamod:Source void UTIL_TrimLeft(char *buffer) { diff --git a/modules/cstrike/cstrike/CstrikeNatives.cpp b/modules/cstrike/cstrike/CstrikeNatives.cpp index 161be814..ed8aee2d 100644 --- a/modules/cstrike/cstrike/CstrikeNatives.cpp +++ b/modules/cstrike/cstrike/CstrikeNatives.cpp @@ -19,6 +19,7 @@ #include "CstrikeHLTypeConversion.h" #include #include +#include bool NoKifesMode = false; @@ -898,7 +899,7 @@ static cell AMX_NATIVE_CALL cs_set_user_model(AMX *amx, cell *params) GET_OFFSET("CBasePlayer", m_modelIndexPlayer); char model[260]; - UTIL_Format(model, sizeof(model), "models/player/%s/%s.mdl", newModel, newModel); + ke::SafeSprintf(model, sizeof(model), "models/player/%s/%s.mdl", newModel, newModel); for (size_t i = 0; i < HL_MODEL_MAX; ++i) { diff --git a/modules/cstrike/csx/WinCSX/AMBuilder b/modules/cstrike/csx/WinCSX/AMBuilder index 3fdaa468..b2629056 100644 --- a/modules/cstrike/csx/WinCSX/AMBuilder +++ b/modules/cstrike/csx/WinCSX/AMBuilder @@ -6,7 +6,7 @@ binary = AMXX.Program(builder, 'WinCSX') binary.compiler.includes += [ os.path.join(builder.currentSourcePath, 'resources'), ] -binary.compiler.defines += ['_MBCS'] +binary.compiler.defines += ['_MBCS', 'HAVE_STDINT_H'] binary.compiler.linkflags += [ 'comctl32.lib', ] diff --git a/modules/cstrike/csx/WinCSX/WinCSX.cpp b/modules/cstrike/csx/WinCSX/WinCSX.cpp index 16bc22b1..0711bd5b 100644 --- a/modules/cstrike/csx/WinCSX/WinCSX.cpp +++ b/modules/cstrike/csx/WinCSX/WinCSX.cpp @@ -11,24 +11,7 @@ #include "WinCSX.h" #include #include "commctrl.h" - -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} +#include int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, @@ -196,7 +179,7 @@ void UpdateListBox(HWND hDlg) { //if ((*b).getPosition() < 1) // umm... naaah! //continue; - UTIL_Format(tempbuffer, sizeof(tempbuffer)-1, "%s", (*b).getName()); + ke::SafeSprintf(tempbuffer, sizeof(tempbuffer)-1, "%s", (*b).getName()); SendMessage( // returns LRESULT in lResult listbox, // handle to destination control @@ -343,7 +326,7 @@ void SaveChanges(HWND hDlg) { UpdateListBox(hDlg); char buffer[256]; - UTIL_Format(buffer, sizeof(buffer)-1, "New rank of %s: %d", name, newPosition); + ke::SafeSprintf(buffer, sizeof(buffer)-1, "New rank of %s: %d", name, newPosition); MessageBox(hDlg, buffer, "Update succeeded", MB_OK); // In the listbox, we need to reselect the item we just updated. Use the new name. diff --git a/modules/engine/engine.cpp b/modules/engine/engine.cpp index 81f4c11d..bbe28a01 100644 --- a/modules/engine/engine.cpp +++ b/modules/engine/engine.cpp @@ -945,7 +945,7 @@ static cell AMX_NATIVE_CALL traceresult(AMX *amx, cell *params) // (jghg) static cell AMX_NATIVE_CALL get_string(AMX *amx, cell *params) // (string, returnstring[], length) { - UTIL_Format(g_buffer, sizeof(g_buffer)-1, "%s", STRING(params[1])); + ke::SafeSprintf(g_buffer, sizeof(g_buffer)-1, "%s", STRING(params[1])); return MF_SetAmxString(amx, params[2], g_buffer, params[3]); } diff --git a/modules/fakemeta/pev.cpp b/modules/fakemeta/pev.cpp index 16f66f68..5ba8400d 100644 --- a/modules/fakemeta/pev.cpp +++ b/modules/fakemeta/pev.cpp @@ -299,23 +299,23 @@ static cell AMX_NATIVE_CALL amx_pev(AMX *amx,cell *params) return num; } else if (ValType & Ret_Int) { char temp[32]; - UTIL_Format(temp, sizeof(temp)-1, "%d", rets.i); + ke::SafeSprintf(temp, sizeof(temp)-1, "%d", rets.i); return MF_SetAmxString(amx, params[3], temp, size); } else if (ValType == Ret_Float) { char temp[32]; - UTIL_Format(temp, sizeof(temp)-1, "%f", rets.f); + ke::SafeSprintf(temp, sizeof(temp)-1, "%f", rets.f); return MF_SetAmxString(amx, params[3], temp, size); } else if (ValType == Ret_Vec) { char temp[32]; - UTIL_Format(temp, sizeof(temp)-1, "%f %f %f", vr.x, vr.y, vr.z); + ke::SafeSprintf(temp, sizeof(temp)-1, "%f %f %f", vr.x, vr.y, vr.z); return MF_SetAmxString(amx, params[3], temp, size); } else if (ValType == Ret_Bytes2) { char temp[32]; - UTIL_Format(temp, sizeof(temp)-1, "%d %d", rets.ba[0], rets.ba[1]); + ke::SafeSprintf(temp, sizeof(temp)-1, "%d %d", rets.ba[0], rets.ba[1]); return MF_SetAmxString(amx, params[3], temp, size); } else if (ValType == Ret_Bytes4) { char temp[32]; - UTIL_Format(temp, sizeof(temp)-1, "%d %d %d %d", rets.ba[0], rets.ba[1], rets.ba[2], rets.ba[3]); + ke::SafeSprintf(temp, sizeof(temp)-1, "%d %d %d %d", rets.ba[0], rets.ba[1], rets.ba[2], rets.ba[3]); return MF_SetAmxString(amx, params[3], temp, size); } diff --git a/modules/geoip/geoip_main.cpp b/modules/geoip/geoip_main.cpp index 7d778db3..6d88eb98 100644 --- a/modules/geoip/geoip_main.cpp +++ b/modules/geoip/geoip_main.cpp @@ -192,7 +192,7 @@ bool loadDatabase() // MF_BuildPathname not used because backslash // makes CreateFileMapping failing under windows. - UTIL_Format(file, sizeof(file) - 1, "%s/%s/GeoLite2-%s.mmdb", modName, dataDir, databases[i]); + ke::SafeSprintf(file, sizeof(file) - 1, "%s/%s/GeoLite2-%s.mmdb", modName, dataDir, databases[i]); status = MMDB_open(file, MMDB_MODE_MMAP, &HandleDB); diff --git a/modules/geoip/geoip_natives.cpp b/modules/geoip/geoip_natives.cpp index 3d58f538..94a3b68f 100644 --- a/modules/geoip/geoip_natives.cpp +++ b/modules/geoip/geoip_natives.cpp @@ -157,7 +157,7 @@ static cell AMX_NATIVE_CALL amx_geoip_region_code(AMX *amx, cell *params) if (countryCode) { finalLength = length + 1; // + 1 for dash. - UTIL_Format(code, finalLength + 1, "%s-", countryCode); // + EOS. + ke::SafeSprintf(code, finalLength + 1, "%s-", countryCode); // + EOS. const char *pathRegion[] = { "subdivisions", "0", "iso_code", NULL }; // First result. const char *regionCode = lookupString(ip, pathRegion, &length); diff --git a/modules/hamsandwich/config_parser.cpp b/modules/hamsandwich/config_parser.cpp index 7de22365..7589df92 100644 --- a/modules/hamsandwich/config_parser.cpp +++ b/modules/hamsandwich/config_parser.cpp @@ -16,6 +16,7 @@ #include "ham_const.h" #include "hooklist.h" #include "offsets.h" +#include extern hook_t hooklist[]; @@ -108,7 +109,7 @@ static void read_mirror(char *input) *data='\0'; // mark down the source - UTIL_Format(source, sizeof(source)-1, "%s", input); + ke::SafeSprintf(source, sizeof(source)-1, "%s", input); *data=old; @@ -128,13 +129,13 @@ static void read_mirror(char *input) old=*data; *data='\0'; - UTIL_Format(dest, sizeof(dest)-1, "%s", data2); + ke::SafeSprintf(dest, sizeof(dest)-1, "%s", data2); *data=old; if (strcmp(dest, CurrentModName)==0) { - UTIL_Format(CurrentModName, sizeof(CurrentModName)-1, "%s", source); + ke::SafeSprintf(CurrentModName, sizeof(CurrentModName)-1, "%s", source); } } @@ -313,7 +314,7 @@ int ReadConfig(void) FILE *fp=fopen(FileName,"r"); - UTIL_Format(CurrentModName, sizeof(CurrentModName)-1, "%s", MF_GetModname()); + ke::SafeSprintf(CurrentModName, sizeof(CurrentModName)-1, "%s", MF_GetModname()); if (!fp) { diff --git a/modules/hamsandwich/ham_utils.h b/modules/hamsandwich/ham_utils.h index b161bb53..1fafc500 100644 --- a/modules/hamsandwich/ham_utils.h +++ b/modules/hamsandwich/ham_utils.h @@ -17,16 +17,17 @@ #include "amxxmodule.h" #include "offsets.h" #include "NEW_Util.h" +#include #define CHECK_FUNCTION(x) \ if (x < 0 || x >= HAM_LAST_ENTRY_DONT_USE_ME_LOL) { \ char msg[1024]; \ - UTIL_Format(msg, sizeof(msg)-1, "Function out of bounds. Got: %d Max: %d", x, HAM_LAST_ENTRY_DONT_USE_ME_LOL - 1); \ + ke::SafeSprintf(msg, sizeof(msg)-1, "Function out of bounds. Got: %d Max: %d", x, HAM_LAST_ENTRY_DONT_USE_ME_LOL - 1); \ FailPlugin(amx, x, HAM_INVALID_FUNC, msg); \ return 0; \ } else if (hooklist[x].isset == 0) { \ char msg[1024]; \ - UTIL_Format(msg, sizeof(msg)-1, "Function %s is not configured in hamdata.ini.", hooklist[x].name); \ + ke::SafeSprintf(msg, sizeof(msg)-1, "Function %s is not configured in hamdata.ini.", hooklist[x].name); \ FailPlugin(amx, x, HAM_FUNC_NOT_CONFIGURED, msg); \ return 0; \ } diff --git a/modules/hamsandwich/hook.h b/modules/hamsandwich/hook.h index f57bfcb8..1d6993e3 100644 --- a/modules/hamsandwich/hook.h +++ b/modules/hamsandwich/hook.h @@ -17,6 +17,7 @@ #include "forward.h" #include "Trampolines.h" #include +#include #define ALIGN(ar) ((intptr_t)ar & ~(sysconf(_SC_PAGESIZE)-1)) @@ -62,7 +63,7 @@ public: size_t len=strlen(name); ent=new char[len+1]; - UTIL_Format(ent, len + 1, "%s", name); + ke::SafeSprintf(ent, len + 1, "%s", name); }; ~Hook() diff --git a/modules/hamsandwich/hook_native.cpp b/modules/hamsandwich/hook_native.cpp index a9544513..80ae274b 100644 --- a/modules/hamsandwich/hook_native.cpp +++ b/modules/hamsandwich/hook_native.cpp @@ -707,7 +707,7 @@ static cell AMX_NATIVE_CALL RegisterHamFromEntity(AMX *amx, cell *params) // It may very well be wrong (such as lots of TS weapons have the same classname) // but it's the best we can do, and better than nothing. // (only used for display) - UTIL_Format(classname, sizeof(classname) - 1, "%s", STRING(Entity->v.classname)); + ke::SafeSprintf(classname, sizeof(classname) - 1, "%s", STRING(Entity->v.classname)); // If we got here, the function is not hooked Hook *hook = new Hook(vtable, hooklist[func].vtid, hooklist[func].targetfunc, hooklist[func].isvoid, hooklist[func].needsretbuf, hooklist[func].paramcount, classname); diff --git a/modules/mysqlx/mysql/MysqlDriver.cpp b/modules/mysqlx/mysql/MysqlDriver.cpp index 8afa7125..01974835 100644 --- a/modules/mysqlx/mysql/MysqlDriver.cpp +++ b/modules/mysqlx/mysql/MysqlDriver.cpp @@ -14,6 +14,7 @@ #include "amxxmodule.h" #include "MysqlDriver.h" #include "MysqlDatabase.h" +#include using namespace SourceMod; @@ -47,7 +48,7 @@ IDatabase *MysqlDriver::_Connect(DatabaseInfo *info, int *errcode, char *error, *errcode = -1; if (error && maxlength) { - UTIL_Format(error, maxlength, "Initialization failed"); + ke::SafeSprintf(error, maxlength, "Initialization failed"); } return NULL; } @@ -89,7 +90,7 @@ IDatabase *MysqlDriver::_Connect(DatabaseInfo *info, int *errcode, char *error, } if (error && maxlength) { - UTIL_Format(error, maxlength, "%s", mysql_error(mysql)); + ke::SafeSprintf(error, maxlength, "%s", mysql_error(mysql)); } return NULL; } diff --git a/modules/mysqlx/mysql/MysqlQuery.cpp b/modules/mysqlx/mysql/MysqlQuery.cpp index f9216ffd..8255a3e5 100644 --- a/modules/mysqlx/mysql/MysqlQuery.cpp +++ b/modules/mysqlx/mysql/MysqlQuery.cpp @@ -15,6 +15,7 @@ #include "MysqlQuery.h" #include "MysqlDatabase.h" #include "MysqlResultSet.h" +#include using namespace SourceMod; @@ -90,7 +91,7 @@ bool MysqlQuery::ExecuteR(QueryInfo *info, char *error, size_t maxlength) info->rs = NULL; if (error && maxlength) { - UTIL_Format(error, maxlength, "%s", mysql_error(m_pDatabase->m_pMysql)); + ke::SafeSprintf(error, maxlength, "%s", mysql_error(m_pDatabase->m_pMysql)); } } else diff --git a/modules/ns/ParticleManager.cpp b/modules/ns/ParticleManager.cpp index c327e269..f9840d0f 100644 --- a/modules/ns/ParticleManager.cpp +++ b/modules/ns/ParticleManager.cpp @@ -26,7 +26,7 @@ void ParticleManager::ReadFile(void) char FileName[256]; - UTIL_Format(FileName, sizeof(FileName)-1, "%s/ns.ps", MF_GetModname()); + ke::SafeSprintf(FileName, sizeof(FileName)-1, "%s/ns.ps", MF_GetModname()); FILE *fp=fopen(FileName,"r"); if (!fp) diff --git a/modules/ns/TitleManager.cpp b/modules/ns/TitleManager.cpp index 28c65a00..301afc9b 100644 --- a/modules/ns/TitleManager.cpp +++ b/modules/ns/TitleManager.cpp @@ -27,7 +27,7 @@ void TitleManager::LoadTitles(void) char FileName[128]; - UTIL_Format(FileName, sizeof(FileName)-1, "%s/titles.txt", MF_GetModname()); + ke::SafeSprintf(FileName, sizeof(FileName)-1, "%s/titles.txt", MF_GetModname()); FILE *fp=fopen(FileName,"r"); diff --git a/modules/ns/amxxapi.cpp b/modules/ns/amxxapi.cpp index b19e24bc..043fc7ce 100644 --- a/modules/ns/amxxapi.cpp +++ b/modules/ns/amxxapi.cpp @@ -23,6 +23,7 @@ #include "ParticleManager.h" #include "AllocString.h" +#include extern int gmsgHudText2; extern BOOL iscombat; @@ -91,9 +92,9 @@ void OnAmxxAttach() char FileName[256]; DLHANDLE DLLBase; #ifdef __linux__ - UTIL_Format(FileName, sizeof(FileName), "%s/dlls/ns_i386.so", MF_GetModname()); + ke::SafeSprintf(FileName, sizeof(FileName), "%s/dlls/ns_i386.so", MF_GetModname()); #else - UTIL_Format(FileName, sizeof(FileName), "%s\\dlls\\ns.dll", MF_GetModname()); + ke::SafeSprintf(FileName, sizeof(FileName), "%s\\dlls\\ns.dll", MF_GetModname()); #endif DLLBase = DLOPEN(FileName); diff --git a/modules/ns/natives/particles.cpp b/modules/ns/natives/particles.cpp index 69dcbafc..2f97e8c4 100644 --- a/modules/ns/natives/particles.cpp +++ b/modules/ns/natives/particles.cpp @@ -48,7 +48,7 @@ cell PSKeyValueI(const char *name, AMX *amx, cell *params) char StrData[1024]; - UTIL_Format(StrData, sizeof(StrData)-1, "%d", params[2]); + ke::SafeSprintf(StrData, sizeof(StrData)-1, "%d", params[2]); kvd.szClassName=const_cast(STRING(reinterpret_cast(params[1])->v.classname)); kvd.szKeyName=name; @@ -71,7 +71,7 @@ cell PSKeyValueF(const char *name, AMX *amx, cell *params) char StrData[1024]; - UTIL_Format(StrData, sizeof(StrData)-1, "%f", amx_ctof2(params[2])); + ke::SafeSprintf(StrData, sizeof(StrData)-1, "%f", amx_ctof2(params[2])); kvd.szClassName=const_cast(STRING(reinterpret_cast(params[1])->v.classname)); kvd.szKeyName=name; diff --git a/modules/nvault/NVault.cpp b/modules/nvault/NVault.cpp index e501d69a..4da289f6 100644 --- a/modules/nvault/NVault.cpp +++ b/modules/nvault/NVault.cpp @@ -367,7 +367,7 @@ bool NVault::GetValue(const char *key, time_t &stamp, char buffer[], size_t len) } stamp = result.stamp; - UTIL_Format(buffer, len, "%s", result.value.chars()); + ke::SafeSprintf(buffer, len, "%s", result.value.chars()); return true; } diff --git a/modules/sqlite/sqlitepp/SqliteDriver.cpp b/modules/sqlite/sqlitepp/SqliteDriver.cpp index f4d8e74f..530c98cb 100644 --- a/modules/sqlite/sqlitepp/SqliteDriver.cpp +++ b/modules/sqlite/sqlitepp/SqliteDriver.cpp @@ -15,6 +15,7 @@ #include "SqliteHeaders.h" #include "SqliteDriver.h" #include "SqliteDatabase.h" +#include #if defined WIN32 #define WINDOWS_LEAN_AND_MEAN @@ -62,7 +63,7 @@ IDatabase *SqliteDriver::Connect(DatabaseInfo *info, int *errcode, char *error, } if (error) { - UTIL_Format(error, maxlength, "%s", sqlite3_errmsg(pSql)); + ke::SafeSprintf(error, maxlength, "%s", sqlite3_errmsg(pSql)); } sqlite3_close(pSql); return NULL; diff --git a/modules/sqlite/sqlitepp/SqliteQuery.cpp b/modules/sqlite/sqlitepp/SqliteQuery.cpp index d04b7fff..2cf8e030 100644 --- a/modules/sqlite/sqlitepp/SqliteQuery.cpp +++ b/modules/sqlite/sqlitepp/SqliteQuery.cpp @@ -15,6 +15,7 @@ #include "SqliteQuery.h" #include "SqliteDatabase.h" #include "SqliteResultSet.h" +#include using namespace SourceMod; @@ -92,7 +93,7 @@ bool SqliteQuery::ExecuteR(QueryInfo *info, char *error, size_t maxlength) { if (error && maxlength && errmsg) { - UTIL_Format(error, maxlength, "%s", errmsg); + ke::SafeSprintf(error, maxlength, "%s", errmsg); } info->affected_rows = 0; info->errorcode = err; diff --git a/public/sdk/amxxmodule.cpp b/public/sdk/amxxmodule.cpp index 7528f376..e79c7cff 100644 --- a/public/sdk/amxxmodule.cpp +++ b/public/sdk/amxxmodule.cpp @@ -3134,24 +3134,6 @@ unsigned short FixedUnsigned16( float value, float scale ) } #endif // USE_METAMOD -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - size_t len = vsnprintf(buffer, maxlength, fmt, ap); - va_end(ap); - - if (len >= maxlength) - { - buffer[maxlength - 1] = '\0'; - return (maxlength - 1); - } - else - { - return len; - } -} - template unsigned int strncopy(char *, const char *src, size_t count); template unsigned int strncopy(cell *, const char *src, size_t count); template unsigned int strncopy(cell *, const cell *src, size_t count); diff --git a/public/sdk/amxxmodule.h b/public/sdk/amxxmodule.h index adf081e9..279d4f68 100644 --- a/public/sdk/amxxmodule.h +++ b/public/sdk/amxxmodule.h @@ -2508,7 +2508,6 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons #endif //MEMORY_TEST -size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); template unsigned int strncopy(D *dest, const S *src, size_t count); #endif // #ifndef __AMXXMODULE_H__