From 544fb12af940b12e795357ce47c250d28e9987e1 Mon Sep 17 00:00:00 2001 From: shikhin Date: Sun, 26 Mar 2023 20:07:53 +0530 Subject: [PATCH] Check null-terminating byte in open_file --- ponydos.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ponydos.asm b/ponydos.asm index 34dc072..30ba7e1 100644 --- a/ponydos.asm +++ b/ponydos.asm @@ -337,7 +337,8 @@ open_file: push bx push es - ; Stolen from https://stackoverflow.com/a/72746473, get strlen in cx + ; Stolen from https://stackoverflow.com/a/72746473, get strlen (including + ; null-termination) in cx mov cx, ds mov es, cx mov di, si @@ -345,7 +346,6 @@ open_file: xor ax, ax repne scasb not cx - dec cx mov es, ax ;mov ax, 1