From 843c01851084d780ae2002f262156d8cfb9f592c Mon Sep 17 00:00:00 2001 From: CrazyEttin <> Date: Mon, 31 May 2021 18:48:13 +0300 Subject: [PATCH] Include the string-ending null for maximum length strings within the string length. --- src/os.asm | 5 +---- src/readstr.inc | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/os.asm b/src/os.asm index 32ceb13..c10c13a 100644 --- a/src/os.asm +++ b/src/os.asm @@ -106,8 +106,5 @@ db "keycode", 0x0 error: db "Unknown command", 0x0 -;buffer: -;times 0x100 db 0 - buffer: -times 0x100 db 0 +times 0xff db 0 diff --git a/src/readstr.inc b/src/readstr.inc index 61ee4d2..aea9922 100644 --- a/src/readstr.inc +++ b/src/readstr.inc @@ -38,7 +38,9 @@ cmp al, 0x8 je .backspace ;Check for input end -cmp bl, [.length] +mov cl, bl +inc cl +cmp cl, [.length] je .loop ;Check for space