diff --git a/Descent3/dedicated_server.cpp b/Descent3/dedicated_server.cpp index 9b133ab6..57a9b143 100644 --- a/Descent3/dedicated_server.cpp +++ b/Descent3/dedicated_server.cpp @@ -328,7 +328,7 @@ int LoadServerConfigFile() { } if (GameArgs[t + 1][0]) { - strcpy(Netgame.server_config_name, GameArgs[t + 1]); + Netgame.server_config_name = GameArgs[t + 1]; } else { PrintDedicatedMessage(TXT_DS_MISSINGCONFIG); PrintDedicatedMessage("\n"); @@ -337,7 +337,7 @@ int LoadServerConfigFile() { // open file if (!inf.Open(Netgame.server_config_name, "[server config file]", DedicatedServerLex)) { - PrintDedicatedMessage(TXT_DS_BADCONFIG, Netgame.server_config_name); + PrintDedicatedMessage(TXT_DS_BADCONFIG, Netgame.server_config_name.u8string().c_str()); PrintDedicatedMessage("\n"); return 0; } @@ -346,7 +346,8 @@ int LoadServerConfigFile() { while (inf.ReadLine()) { int cmd; - while ((cmd = inf.ParseLine(operand, INFFILE_LINELEN)) > INFFILE_ERROR) { + while ((cmd = inf.ParseLine(operand, INFFILE_LINELEN)) > INFFILE_ERROR && + cmd != INFFILE_SYMBOL) { SetCVar(CVars[cmd].varname, operand, true); } } diff --git a/Descent3/multi_external.h b/Descent3/multi_external.h index 9d375185..83bfe419 100644 --- a/Descent3/multi_external.h +++ b/Descent3/multi_external.h @@ -121,6 +121,7 @@ typedef int HANDLE; #include "descent.h" //for MSN_NAMELEN #include "byteswap.h" #include +#include #define NETGAME_NAME_LEN 32 #define NETGAME_SCRIPT_LEN 32 @@ -249,7 +250,7 @@ struct netgame_info { char mission[MSN_NAMELEN]; char mission_name[MISSION_NAME_LEN]; char scriptname[NETGAME_SCRIPT_LEN]; - char server_config_name[PAGENAME_LEN]; + std::filesystem::path server_config_name; char connection_name[PAGENAME_LEN]; network_address server_address; // The address of the server that we're talking to - not used if we are the server diff --git a/cfile/inffile.cpp b/cfile/inffile.cpp index 820bc2f1..73c5a355 100644 --- a/cfile/inffile.cpp +++ b/cfile/inffile.cpp @@ -60,7 +60,7 @@ void InfFile::FreeSymbols() { while ((sym = m_sym_list.start()) != 0) { sym = m_sym_list.unlink(); if (sym->t.text) - delete sym->t.text; + delete[] sym->t.text; delete sym; } } diff --git a/netcon/includes/mdllinit.h b/netcon/includes/mdllinit.h index 017ce67e..2c3895a5 100644 --- a/netcon/includes/mdllinit.h +++ b/netcon/includes/mdllinit.h @@ -311,8 +311,8 @@ DLLNum_modems_found = (int *)API.vp[24]; DLLUse_DirectPlay = (bool *)API.vp[22]; #endif DLLDedicated_server = (bool *)API.vp[25]; -DLLTCP_active = (BOOL)*API.vp[26]; -DLLIPX_active = (BOOL)*API.vp[27]; +DLLTCP_active = *(bool *)API.vp[26]; +DLLIPX_active = *(bool *)API.vp[27]; DLLnw_ListenPort = (uint16_t)((size_t)API.vp[28] & 0xffff); DLLMulti_Gamelist_changed = (bool *)API.vp[29]; DLLPXO_hosted_lobby_name = (char *)API.vp[30];