1) REALLY fix strcat crash (git restored wrong file in previous commit) 2) fopen: less labels ffs
This commit is contained in:
@@ -66,10 +66,12 @@ strcpy:
|
||||
; r8* Backup for rdi (point to start of dest)
|
||||
; r9* Backup for rsi
|
||||
; r10* Backup for rdi (point to end of dest)
|
||||
; r11* Backup for strlen(dest)
|
||||
strcat:
|
||||
mov r8, rdi
|
||||
mov r9, rsi
|
||||
call strlen
|
||||
mov r11, rax
|
||||
sub rdx, rax
|
||||
dec rdi
|
||||
mov r10, rdi
|
||||
@@ -78,13 +80,17 @@ strcat:
|
||||
cmp rax, rdx
|
||||
jb .copy
|
||||
dec rdx
|
||||
|
||||
.copy:
|
||||
cmp rdx, r11
|
||||
jle .quit
|
||||
mov rcx, rdx
|
||||
mov rsi, r9
|
||||
mov rdi, r10
|
||||
cld
|
||||
rep movsb
|
||||
mov byte [rdi], EOS
|
||||
.quit:
|
||||
mov rax, r8
|
||||
ret
|
||||
|
||||
|
Reference in New Issue
Block a user