From e1e832e8f63046bdea329a8f82b6d88131c1d09e Mon Sep 17 00:00:00 2001 From: Cabergs Charles Date: Wed, 9 Oct 2019 16:53:13 +0200 Subject: WIP: removed free Doesnt work with some buffer sizes --- get_next_line.h | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'get_next_line.h') diff --git a/get_next_line.h b/get_next_line.h index d4c866a..7aa51e9 100644 --- a/get_next_line.h +++ b/get_next_line.h @@ -1,15 +1,39 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* get_next_line.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/09 16:24:58 by cacharle #+# #+# */ +/* Updated: 2019/10/09 16:42:51 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* get_next_line.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2019/10/09 13:52:59 by cacharle #+# #+# */ +/* Updated: 2019/10/09 16:24:26 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + #ifndef GET_NEXT_LINE_H # define GET_NEXT_LINE_H # ifndef BUFFER_SIZE -# define BUFFER_SIZE (1 << 8) +# define BUFFER_SIZE (15) + # endif # define LINE_READ 1 -# define NO_LINE_READ 0 +# define END_OF_FILE 0 # define ERROR -1 - /* ** get_next_line.c */ @@ -21,8 +45,7 @@ int get_next_line(int fd, char **line); */ int find_newline(char *str); -char *strappend(char *dest, char *src); -char *ft_strcpy(char *dest, const char *src); +char *ft_strncpy(char *dest, const char *src, size_t n); char *ft_strcat(char *dest, const char *src); int ft_strlen(char *str); -- cgit