projects
/
rrq
/
rrqforth.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39427ae
)
make strncmp direction safe
author
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Tue, 15 Jun 2021 05:22:02 +0000
(15:22 +1000)
committer
Ralph Ronnquist
<ralph.ronnquist@gmail.com>
Tue, 15 Jun 2021 05:22:02 +0000
(15:22 +1000)
wordlists.asm
patch
|
blob
|
history
diff --git
a/wordlists.asm
b/wordlists.asm
index 0ee7aecedb83c134e75a86d0f82f30661015a27b..1604168c5bb754c7f6122cfb1bcacc9ffa6b8692 100644
(file)
--- a/
wordlists.asm
+++ b/
wordlists.asm
@@
-88,12
+88,20
@@
p_strlen_LOOP:
pop rsi
cmp rcx,0
jle p_strncpy_END
- cld
+ cmp rdi,rsi
+ je p_strncpy_END
+ jl p_strncpy_LOOP
+ ;; copy down
+ std ; Direction is decrementing
+ add rdi,rcx
+ dec rdi
+ add rsi,rcx
+ dec rsi
p_strncpy_LOOP:
+ rep
movsb
- dec rcx
- jg p_strncpy_LOOP
p_strncpy_END:
+ cld ; Restore default direction as incrementing
popr rsi
next