From e84d0ea7745934404f4ef983c8a33da01b78b9f1 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 29 Dec 2025 16:58:18 +0100 Subject: [PATCH] feat(read): adding the return value on -1 if the buf is NULL --- src/ft_read.s | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ft_read.s b/src/ft_read.s index 3cbabc3..5eb489c 100644 --- a/src/ft_read.s +++ b/src/ft_read.s @@ -7,6 +7,7 @@ section .text ft_read: 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 mov rax, 0 ; syscall 0 is for read syscall ; call the system call read