1) REALLY fix strcat crash (git restored wrong file in previous commit) 2) fopen: less labels ffs

This commit is contained in:
2025-07-27 21:17:59 +02:00
parent ca6d6e6d31
commit f18de90868
2 changed files with 13 additions and 10 deletions

View File

@@ -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