diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2021-05-09 12:23:39 -0400 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2021-05-09 12:23:39 -0400 |
commit | f8c2e25b4ab337789a2e468a8f0aadb0c7fda42f (patch) | |
tree | c7c8b68dbbb216c903c7219c0d68c408d5a427d2 /programs/sub-suite | |
parent | 98886be8aa8508feabbcd8f232ba85ef46a7a139 (diff) |
Replace call to memcpy, with call to memcpy_dir.
This fixes a bug where when shifting the line left, it
would overwrite everything after the cursor with the
character at the cursor's position.
The reason this was happening is because memcpy copies
from start to end, and because the destination is more
than one byte ahead of the source, it overwrites the
next length source bytes, which will repeat until it's
copied n bytes.
Diffstat (limited to 'programs/sub-suite')
-rw-r--r-- | programs/sub-suite/subeditor.s | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/programs/sub-suite/subeditor.s b/programs/sub-suite/subeditor.s index 8337f51..1525fa8 100644 --- a/programs/sub-suite/subeditor.s +++ b/programs/sub-suite/subeditor.s @@ -898,7 +898,7 @@ shftln: lea d, (x+a) ; Get the address of the string pointer, at the cursor position, plus the offset. mov f, b ; Get the old end position. sub f, y ; Subtract the old end position, by the cursor position. - jsr memcpy ; Copy the string from the cursor, to the cursor plus the offset. + jsr memcpy_dir ; Copy the string from the cursor, to the cursor plus the offset. @clear: tya ; Get the cursor position. and c, c ; Is the left flag set? |