From cc89352ce56e3726af949e75ea5332031955ff82 Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Wed, 11 Oct 2023 18:22:48 +0200 Subject: [PATCH] Changed ft_strncat_alloc argument to const char *. Added a commentary on a function. --- get_next_line.h | 4 ++-- get_next_line_utils.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/get_next_line.h b/get_next_line.h index 65cff09..9f951da 100644 --- a/get_next_line.h +++ b/get_next_line.h @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/08/28 11:24:52 by ljiriste #+# #+# */ -/* Updated: 2023/09/11 18:44:28 by ljiriste ### ########.fr */ +/* Updated: 2023/10/11 18:16:37 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -36,7 +36,7 @@ char *get_next_line(int fd); t_list *new_ft_node(int fd); t_list *ft_lstnew(void *content); void *ft_memmove(void *dest, const void *src, size_t n); -void ft_strncat_alloc(char **dest, char *src, int n); +void ft_strncat_alloc(char **dest, const char *src, int n); char *get_next_line(int fd); diff --git a/get_next_line_utils.c b/get_next_line_utils.c index ec03e25..fb4048a 100644 --- a/get_next_line_utils.c +++ b/get_next_line_utils.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/09/11 13:36:53 by ljiriste #+# #+# */ -/* Updated: 2023/09/11 15:22:45 by ljiriste ### ########.fr */ +/* Updated: 2023/10/11 15:42:18 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,8 +17,10 @@ #include // malloc etc. #include "get_next_line.h" -// This function may be useful enough to add to Libft -void ft_strncat_alloc(char **dest, char *src, int n) +//This function may be useful enough to add to Libft +/* Functions like ft_strncat but reallocates dest to + make sure it is large enough */ +void ft_strncat_alloc(char **dest, const char *src, int n) { int size; char *temp; -- 2.30.2