diff --git a/src/network/core/config.h b/src/network/core/config.h index 648ef2a35c..560d486663 100644 --- a/src/network/core/config.h +++ b/src/network/core/config.h @@ -51,7 +51,6 @@ static const uint8_t NETWORK_COORDINATOR_VERSION = 6; ///< Wh static const uint8_t NETWORK_SURVEY_VERSION = 2; ///< What version of the survey do we use? static const uint NETWORK_NAME_LENGTH = 80; ///< The maximum length of the server name and map name, in bytes including '\0' -static const uint NETWORK_COMPANY_NAME_LENGTH = 128; ///< The maximum length of the company name, in bytes including '\0' static const uint NETWORK_HOSTNAME_LENGTH = 80; ///< The maximum length of the host name, in bytes including '\0' static const uint NETWORK_HOSTNAME_PORT_LENGTH = 80 + 6; ///< The maximum length of the host name + port, in bytes including '\0'. The extra six is ":" + port number (with a max of 65536) static const uint NETWORK_REVISION_LENGTH = 33; ///< The maximum length of the revision, in bytes including '\0' diff --git a/src/network/network.cpp b/src/network/network.cpp index 31f45bf150..991cbb1694 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -85,8 +85,6 @@ uint32_t _sync_seed_2; ///< Second part of the seed. uint32_t _sync_frame; ///< The frame to perform the sync check. bool _network_first_time; ///< Whether we have finished joining or not. -static_assert((int)NETWORK_COMPANY_NAME_LENGTH == MAX_LENGTH_COMPANY_NAME_CHARS * MAX_CHAR_LENGTH); - /** The amount of clients connected */ uint8_t _network_clients_connected = 0; diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 51c64e261e..3007852001 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -441,7 +441,7 @@ template static inline void SanitizeSingleStringHelper([[maybe_unused]] CommandFlags cmd_flags, T &data) { if constexpr (std::is_same_v) { - data = StrMakeValid(data.substr(0, NETWORK_COMPANY_NAME_LENGTH), (!_network_server && cmd_flags & CMD_STR_CTRL) != 0 ? SVS_ALLOW_CONTROL_CODE | SVS_REPLACE_WITH_QUESTION_MARK : SVS_REPLACE_WITH_QUESTION_MARK); + data = StrMakeValid(data, (!_network_server && HasFlag(cmd_flags, CMD_STR_CTRL)) ? SVS_ALLOW_CONTROL_CODE | SVS_REPLACE_WITH_QUESTION_MARK : SVS_REPLACE_WITH_QUESTION_MARK); } }