Fix: EOS not copied to dest in strcpy()
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user