diff --git a/license.txt b/license.txt index 5c9031b..a57e788 100644 --- a/license.txt +++ b/license.txt @@ -1,7 +1,7 @@ gmsv_serversecure A module for Garry's Mod that mitigates exploits on the Source engine. ----------------------------------------------------------------------- -Copyright (c) 2015-2022, Daniel Almeida +Copyright (c) 2015-2023, Daniel Almeida All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/source/netfilter/core.cpp b/source/netfilter/core.cpp index b1d3add..6bd13dd 100644 --- a/source/netfilter/core.cpp +++ b/source/netfilter/core.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -224,11 +225,11 @@ class Core { if (!gamemode.name.empty()) { // Check if gamemode name ends with "_modded" - static const std::string suffix = "_modded"; - auto gm_name = gamemode.name; + static const std::string_view suffix = "_modded"; + std::string_view gm_name = gamemode.name; if (gm_name.size() > suffix.size() && - std::equal(gm_name.rbegin(), gm_name.rend(), suffix.rbegin())) { - gm_name = gm_name.substr(0, suffix.size()); + gm_name.substr(gm_name.size() - suffix.size()) == suffix) { + gm_name = gm_name.substr(0, gm_name.size() - suffix.size()); } reply_info.tags.gm = gm_name;