Check null-terminating byte in open_file
This commit is contained in:
parent
9ac938a5f8
commit
544fb12af9
|
@ -337,7 +337,8 @@ open_file:
|
||||||
push bx
|
push bx
|
||||||
push es
|
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 cx, ds
|
||||||
mov es, cx
|
mov es, cx
|
||||||
mov di, si
|
mov di, si
|
||||||
|
@ -345,7 +346,6 @@ open_file:
|
||||||
xor ax, ax
|
xor ax, ax
|
||||||
repne scasb
|
repne scasb
|
||||||
not cx
|
not cx
|
||||||
dec cx
|
|
||||||
|
|
||||||
mov es, ax
|
mov es, ax
|
||||||
;mov ax, 1
|
;mov ax, 1
|
||||||
|
|
Loading…
Reference in New Issue