Fixed more segfaults, final commit ?

This commit is contained in:
2024-03-18 13:40:09 +01:00
parent ddabaeba7f
commit 56d82c386f
8 changed files with 44 additions and 32 deletions

View File

@@ -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