diff --git a/season_halloween/scripting/season_halloween.sp b/season_halloween/scripting/season_halloween.sp index 713e0ea3..61dc7862 100644 --- a/season_halloween/scripting/season_halloween.sp +++ b/season_halloween/scripting/season_halloween.sp @@ -660,12 +660,12 @@ public void HookCallback(const char[] output, int caller, int activator, float d char sName[MAX_NAME_LENGTH]; GetClientName(client, sName, sizeof(sName)); + char sSafeName[(2*MAX_NAME_LENGTH)+1]; + g_hDatabase.Escape(sName, sSafeName, sizeof(sSafeName)); char sQuery[256]; - Format(sQuery, sizeof(sQuery), "INSERT INTO halloween_table (steam_auth,name,collected) VALUES ('%s','%s',1) ON DUPLICATE KEY UPDATE collected=collected+1;", sSteamID, sName); - char sSafeQuery[1024]; - g_hDatabase.Escape(sQuery, sSafeQuery, sizeof(sSafeQuery)); - g_hDatabase.Query(SQL_OnQueryCompletedUpdate, sSafeQuery); + Format(sQuery, sizeof(sQuery), "INSERT INTO halloween_table (steam_auth,name,collected) VALUES ('%s','%s',1) ON DUPLICATE KEY UPDATE collected=collected+1;", sSteamID, sSafeName); + g_hDatabase.Query(SQL_OnQueryCompletedUpdate, sQuery); g_iCollected[client] += 1; CheckAndAddFlag(client);