From ff928f63665dfd62a13f780855ddaf64c1079400 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kha=C3=AFs=20COLIN?= Date: Thu, 31 Oct 2024 13:48:24 +0100 Subject: [PATCH] Add check for minimum buffer size --- get_next_line.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/get_next_line.h b/get_next_line.h index 88f517f..fa73905 100644 --- a/get_next_line.h +++ b/get_next_line.h @@ -19,6 +19,9 @@ # ifndef BUFFER_SIZE # define BUFFER_SIZE 1024 # endif +# if BUFFER_SIZE <= 1 +# error BUFFER_SIZE must be at least 2 +# endif char *get_next_line(int fd);