diff --git a/src/pc/network/coopnet/coopnet.c b/src/pc/network/coopnet/coopnet.c index 03902940..0835f728 100644 --- a/src/pc/network/coopnet/coopnet.c +++ b/src/pc/network/coopnet/coopnet.c @@ -22,7 +22,7 @@ uint64_t gCoopNetDesiredLobby = 0; char gCoopNetPassword[64] = ""; -char sCoopNetDescription[512] = ""; +char sCoopNetDescription[MAX_COOPNET_DESCRIPTION_LENGTH] = ""; static uint64_t sLocalLobbyId = 0; static uint64_t sLocalLobbyOwnerId = 0; @@ -176,7 +176,7 @@ bool ns_coopnet_is_connected(void) { static void coopnet_populate_description(void) { char* buffer = sCoopNetDescription; - int bufferLength = 1024; + int bufferLength = MAX_COOPNET_DESCRIPTION_LENGTH; // get version const char* version = get_version_online(); int versionLength = strlen(version); diff --git a/src/pc/network/coopnet/coopnet.h b/src/pc/network/coopnet/coopnet.h index ec094c7d..3a00dddd 100644 --- a/src/pc/network/coopnet/coopnet.h +++ b/src/pc/network/coopnet/coopnet.h @@ -2,6 +2,8 @@ #define COOPNET_H #ifdef COOPNET +#define MAX_COOPNET_DESCRIPTION_LENGTH 1024 + typedef void (*QueryCallbackPtr)(uint64_t aLobbyId, uint64_t aOwnerId, uint16_t aConnections, uint16_t aMaxConnections, const char* aGame, const char* aVersion, const char* aHostName, const char* aMode, const char* aDescription); typedef void (*QueryFinishCallbackPtr)(void);