feat(read): adding the return value on -1 if the buf is NULL
This commit is contained in:
parent
13be686bcd
commit
e84d0ea774
1 changed files with 1 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ section .text
|
||||||
|
|
||||||
ft_read:
|
ft_read:
|
||||||
cmp rsi, 0 ; check if the buffer is NULL
|
cmp rsi, 0 ; check if the buffer is NULL
|
||||||
|
mov rax, -1 ; set the return value to -1 (for error) (UB)
|
||||||
je .exit ; if true go to exit
|
je .exit ; if true go to exit
|
||||||
mov rax, 0 ; syscall 0 is for read
|
mov rax, 0 ; syscall 0 is for read
|
||||||
syscall ; call the system call read
|
syscall ; call the system call read
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue