Migrate extensions to common AMTL string funcs (#785)

This commit is contained in:
Michael Flaherty
2018-03-25 13:00:53 -07:00
committed by Kyle Sanderson
parent 6c7e29cbdb
commit 5611ec54a2
19 changed files with 53 additions and 44 deletions
+2 -2
View File
@@ -63,7 +63,7 @@ bool CStrike::SDK_OnLoad(char *error, size_t maxlength, bool late)
#if SOURCE_ENGINE != SE_CSGO
if (strcmp(g_pSM->GetGameFolderName(), "cstrike") != 0)
{
snprintf(error, maxlength, "Cannot Load Cstrike Extension on mods other than CS:S and CS:GO");
ke::SafeStrcpy(error, maxlength, "Cannot Load Cstrike Extension on mods other than CS:S and CS:GO");
return false;
}
#endif
@@ -76,7 +76,7 @@ bool CStrike::SDK_OnLoad(char *error, size_t maxlength, bool late)
{
if (error)
{
snprintf(error, maxlength, "Could not read sm-cstrike.games: %s", conf_error);
ke::SafeSprintf(error, maxlength, "Could not read sm-cstrike.games: %s", conf_error);
}
return false;
}
+2 -2
View File
@@ -357,7 +357,7 @@ ItemDefHashValue *GetHashValueFromWeapon(const char *szWeapon)
{
char tempWeapon[MAX_WEAPON_NAME_LENGTH];
Q_strncpy(tempWeapon, szWeapon, sizeof(tempWeapon));
ke::SafeStrcpy(tempWeapon, sizeof(tempWeapon), szWeapon);
Q_strlower(tempWeapon);
if (strstr(tempWeapon, "weapon_") == NULL && strstr(tempWeapon, "item_") == NULL)
@@ -367,7 +367,7 @@ ItemDefHashValue *GetHashValueFromWeapon(const char *szWeapon)
for (unsigned int i = 0; i < SM_ARRAYSIZE(szClassPrefixs); i++)
{
char classname[MAX_WEAPON_NAME_LENGTH];
Q_snprintf(classname, sizeof(classname), "%s%s", szClassPrefixs[i], tempWeapon);
ke::SafeSprintf(classname, sizeof(classname), "%s%s", szClassPrefixs[i], tempWeapon);
ClassnameMap::Result res = g_mapClassToDefIdx.find(classname);