From 1286fe322d7171e60a96f4d203b22e43141446fd Mon Sep 17 00:00:00 2001 From: y4my4my4m <8145020+y4my4my4m@users.noreply.github.com> Date: Sun, 14 May 2023 01:14:57 +0900 Subject: [PATCH] Fix --- src/Home/Telnet/Telnet.ZC | 8 +++----- src/Home/Telnet/TelnetHelpers.ZC | 5 +++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Home/Telnet/Telnet.ZC b/src/Home/Telnet/Telnet.ZC index b3cef209..698fe202 100644 --- a/src/Home/Telnet/Telnet.ZC +++ b/src/Home/Telnet/Telnet.ZC @@ -116,7 +116,7 @@ U0 HandleControlCodes(U8 ch) { SysLog("case 127"); } if (ch == 0x24) { - DocPrint(term.doc, "$$"); + DocPrint(term.doc, "$$$$"); } if (ch >= 32 && ch < 256) // ZealOS's ASCII is up to 255 { @@ -670,18 +670,16 @@ U0 Telnet(U8 *host=NULL, U16 port=TELNET_PORT) { show_splash: // SplashScreen DocClear; - MemSet(term.buffer, 0, sizeof(term.buffer)); + // Load the file into the buffer and get its size term.buffer_len = ANSIArtLoad(art_path, term.buffer); - if (term.buffer_len > 0) { term.buffer[term.buffer_len] = '\0'; // parse the buffer ANSIParse; } else { - "Error: Could not load splash screen.\n"; + Print("Error: Could not load splash screen.\n"); } - init_connection: while (!term.waiting_for_input || host != NULL) diff --git a/src/Home/Telnet/TelnetHelpers.ZC b/src/Home/Telnet/TelnetHelpers.ZC index 584f1087..95dcb7de 100644 --- a/src/Home/Telnet/TelnetHelpers.ZC +++ b/src/Home/Telnet/TelnetHelpers.ZC @@ -36,7 +36,7 @@ I64 ANSIArtLoad(U8 *filename, U8 *buffer) { I64 full_blocks = file->de.size / BLK_SIZE; I64 remaining_bytes = file->de.size % BLK_SIZE; - SysLog("File size: %d, Number of full blocks: %d, Remaining bytes: %d\n", file->de.size, full_blocks, remaining_bytes); + // SysLog("File size: %d, Number of full blocks: %d, Remaining bytes: %d\n", file->de.size, full_blocks, remaining_bytes); // Read the full blocks into the buffer I64 i, blocks_read = 0; @@ -54,6 +54,7 @@ I64 ANSIArtLoad(U8 *filename, U8 *buffer) { } } + I64 file_size = file->de.size; FClose(file); if (blocks_read != (full_blocks + (remaining_bytes != 0))) { @@ -61,7 +62,7 @@ I64 ANSIArtLoad(U8 *filename, U8 *buffer) { return -1; } - return file->de.size; // Return the number of bytes read + return file_size; // Return the number of bytes read } public I64 ANSIArtBrowser()