Fix: EOS not copied to dest in strcpy()

This commit is contained in:
2025-06-23 16:21:21 +02:00
parent d718f1ff1d
commit 2e7a7c7b5f

View File

@ -20,7 +20,7 @@ strlen:
leave
ret
;----- strcpy(char* dest, char* src) -----;
; return value: pointer to dest or NULL if nothing was copied
; return value: pointer to dest or NULL if nothing was copied (note that EOS is always copied to dest)
strcpy:
push rbp
mov rbp, rsp
@ -36,9 +36,9 @@ strcpy:
inc rdi
inc rcx
jmp .loop
mov byte [rdi], 0x0
.0f:
mov byte [rdi], 0x0
cmp rcx, 0
jne .quit
xor rax, rax