FIX: Return value of strcpy()

This commit is contained in:
2025-06-23 16:28:05 +02:00
parent 2e7a7c7b5f
commit 6463c3711a

View File

@ -25,23 +25,24 @@ strcpy:
push rbp
mov rbp, rsp
mov r11, rdi
xor rax, rax
xor rcx, rcx
.loop:
cmp byte [rsi], 0x0
je .0f
mov r10b, byte [rsi]
mov byte [rdi], r10b
mov byte [r11], r10b
inc rsi
inc rdi
inc r11
inc rcx
jmp .loop
.0f:
mov byte [rdi], 0x0
mov byte [r11], 0x0
cmp rcx, 0
jne .quit
xor rax, rax
je .quit
mov rax, rdi
.quit:
leave