From d4aeabeac0a8bd1665b14aacf487df17198c1ab9 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 12 May 2020 21:40:41 +0200 Subject: Fixing/refactoring ft_getline, fixed/normed ft_memchr, added ft_strmove --- include/libft_io.h | 10 ++++++++-- include/libft_str.h | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libft_io.h b/include/libft_io.h index faeade4..ab40875 100644 --- a/include/libft_io.h +++ b/include/libft_io.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:35:43 by cacharle #+# #+# */ -/* Updated: 2020/05/12 18:00:55 by charles ### ########.fr */ +/* Updated: 2020/05/12 20:36:36 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -33,6 +33,9 @@ char ft_getchar(void); # ifndef FT_GETFILE_BUFFER_SIZE # define FT_GETFILE_BUFFER_SIZE 64 # endif +# if FT_GETFILE_BUFFER_SIZE <= 0 +# error "FT_GETFILE_BUFFER_SIZE must be > 0" +# endif typedef struct s_ftmem { @@ -43,7 +46,10 @@ typedef struct s_ftmem int ft_getfile(int fd, t_ftmem *mem); # ifndef FT_GETLINE_BUFFER_SIZE -# define FT_GETLINE_BUFFER_SIZE 1 +# define FT_GETLINE_BUFFER_SIZE 64 +# endif +# if FT_GETLINE_BUFFER_SIZE <= 0 +# error "FT_GETLINE_BUFFER_SIZE must be > 0" # endif # define FT_LINE 1 diff --git a/include/libft_str.h b/include/libft_str.h index 383c393..41e81ac 100644 --- a/include/libft_str.h +++ b/include/libft_str.h @@ -6,7 +6,7 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/01/31 10:39:22 by cacharle #+# #+# */ -/* Updated: 2020/05/11 15:52:40 by charles ### ########.fr */ +/* Updated: 2020/05/12 20:47:36 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -79,6 +79,7 @@ int ft_strnequ(char const *s1, char const *s2, size_t n); char *ft_strtolower(char *s); char *ft_strtoupper(char *s); char *ft_strcat3(char *dest, const char *src1, const char *src2); +char *ft_strmove(char *dest, const char *src); /* ** glob -- cgit