Removed function from libft

This commit is contained in:
2025-11-16 20:41:09 +01:00
parent a7dbd94e42
commit 110d82cfaa

View File

@@ -6,41 +6,12 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */ /* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 18:37:57 by aortigos #+# #+# */ /* Created: 2024/03/15 18:37:57 by aortigos #+# #+# */
/* Updated: 2025/11/16 20:33:54 by aortigos ### ########.fr */ /* Updated: 2025/11/16 20:40:51 by aortigos ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "get_next_line.h" #include "get_next_line.h"
char *ft_strjoin(char *left_str, char *buff)
{
size_t i;
size_t j;
char *str;
if (!left_str)
{
left_str = (char *)malloc(1 * sizeof(char));
left_str[0] = '\0';
}
if (!left_str || !buff)
return (NULL);
str = malloc(sizeof(char) * ((ft_strlen(left_str))
+ (ft_strlen(buff))) + 1);
if (str == NULL)
return (NULL);
i = -1;
j = 0;
if (left_str)
while (left_str[++i] != '\0')
str[i] = left_str[i];
while (buff[j] != '\0')
str[i++] = buff[j++];
str[ft_strlen(left_str) + ft_strlen(buff)] = '\0';
free(left_str);
return (str);
}
char *ft_get_line(char *left_str) char *ft_get_line(char *left_str)
{ {
int i; int i;