Changed ft_strncat_alloc argument to const char *.
authorLukas Jiriste <ljiriste@student.42prague.com>
Wed, 11 Oct 2023 16:22:48 +0000 (18:22 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Wed, 11 Oct 2023 16:22:48 +0000 (18:22 +0200)
Added a commentary on a function.

get_next_line.h
get_next_line_utils.c

index 65cff09d9961d4516406a612cd5a9ae2073a22a0..9f951daf3e879c7c85d3107970a8e02e75d6bf46 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   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);
 
index ec03e254a493a8c061dd3cee1f30c1416592b56d..fb4048a8cfeea65506c4790a1714d8fa93211fc9 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   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       */
 /*                                                                            */
 /* ************************************************************************** */
 
 #include <stdlib.h>    // 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;