Fixed more segfaults, final commit ?
This commit is contained in:
@@ -2,16 +2,16 @@ global ft_write
|
||||
extern __errno_location
|
||||
|
||||
ft_write:
|
||||
mov eax, 0x1
|
||||
mov eax, 0x1 ; put the syscall number of write
|
||||
syscall
|
||||
test rax, rax
|
||||
js .error
|
||||
ret
|
||||
|
||||
.error:
|
||||
mov ebx, eax
|
||||
mov rdx, rax
|
||||
call __errno_location wrt ..plt
|
||||
neg ebx
|
||||
mov dword [rax], ebx
|
||||
neg rdx
|
||||
mov [rax], rdx
|
||||
mov rax, -1
|
||||
ret
|
||||
Reference in New Issue
Block a user