The code assumed that the source string would be filled with nulls after the end of the string, which was definitely not the case when building in Debug. This caused stack corruption when starting a new game, as garbage data from the source string was copied blindly into the destination buffer.
The code has been modified so that a WAD path will not be copied in if it would overflow the buffer, and an extra check has been added to terminate the loop if the end of the source string is reached.
In addition, I found another issue while debugging where a pipe handle was being closed twice. This is also fixed here.
The code assumed that the source string would be filled with nulls after the end of the string, which was definitely not the case when building in Debug. This caused stack corruption when starting a new game, as garbage data from the source string was copied blindly into the destination buffer.
The code has been modified so that a WAD path will not be copied in if it would overflow the buffer, and an extra check has been added to terminate the loop if the end of the source string is reached.
In addition, I found another issue while debugging where a pipe handle was being closed twice. This is also fixed here.