From f520d9f742d46953f59ed7f30b4c52e8fa964e07 Mon Sep 17 00:00:00 2001 From: Wengier Date: Sun, 31 Jan 2021 23:41:54 -0500 Subject: [PATCH] fix possible issue with HX-DOS build --- CHANGELOG | 2 +- src/dos/dos.cpp | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3b3a86df8b0..0e8321cb7a6 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,7 @@ 0.83.10 - The Windows key(s) in Windows and the Command key(s) in macOS will now be displayed as the "Windows" and - "Command" keys instead of the "super" and "meta" + "Command" keys instead of the "super" and the "meta" keys in SDL1 builds just like SDL2 builds. (Wengier) - Cursor blinking rate for TrueType font (TTF) output can now be customized with the ttf.blinkc option. diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index de00f914d49..8648a1243be 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -1890,8 +1890,15 @@ static Bitu DOS_21Handler(void) { break; case 0x5e: /* Network and printer functions */ if (reg_al == 0 && !control->SecureMode() && enable_network_redirector) { // Get machine name +#if defined(WIN32) + DWORD size = DOSNAMEBUF; + GetComputerName(name1, &size); + if (size) +#else int result = gethostname(name1, DOSNAMEBUF); - if (!result) { + if (!result) +#endif + { strcat(name1, " "); // Simply add 15 spaces if (!strcmp(RunningProgram, "4DOS") || (reg_ip == 0xeb31 && (reg_sp == 0xc25e || reg_sp == 0xc26e))) { // 4DOS expects it to be 0 terminated (not documented) name1[16] = 0;