This commit is contained in:
Angel Ortigosa Perez
2026-01-25 16:57:20 +01:00
parent 16b935470a
commit 8a56a115e7
7 changed files with 44 additions and 36263 deletions

View File

@@ -6,12 +6,18 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 18:37:44 by aortigos #+# #+# */
/* Updated: 2026/01/25 16:06:30 by aortigos ### ########.fr */
/* Updated: 2026/01/25 16:57:02 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
#include "get_next_line.h"
static void free_mem(char *left_str, char *buff)
{
free(left_str);
free(buff);
}
char *ft_read_to_left_str(int fd, char *left_str)
{
char *buff;
@@ -27,8 +33,7 @@ char *ft_read_to_left_str(int fd, char *left_str)
rd_bytes = read(fd, buff, BUFFER_SIZE);
if (rd_bytes == -1)
{
free(left_str);
free(buff);
free_mem(left_str, buff);
return (NULL);
}
buff[rd_bytes] = '\0';