From 6463c3711a813e1266c95f1c8c5048b137028d2e Mon Sep 17 00:00:00 2001 From: Kwarde Date: Mon, 23 Jun 2025 16:28:05 +0200 Subject: [PATCH] FIX: Return value of strcpy() --- string.asm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/string.asm b/string.asm index eba96bc..488be1f 100644 --- a/string.asm +++ b/string.asm @@ -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