sstrcat fix

This commit is contained in:
Jack Halford 2016-12-12 00:42:20 +01:00
parent a60d17a0b9
commit 78390e5d8c
2 changed files with 3 additions and 3 deletions

View file

@ -19,7 +19,7 @@ t_list *ft_lst_find(t_list *begin_list, void *data_ref, int (*cmp)())
list_ptr = begin_list;
while (list_ptr)
{
if ((*cmp)(list_ptr->content, data_ref) == 0)
if ((cmp)(list_ptr->content, data_ref) == 0)
return (list_ptr);
list_ptr = list_ptr->next;
}

View file

@ -26,12 +26,12 @@ char *ft_sstrcat(char **sstr, char sep)
len += ft_strlen(sstr[i++]);
if (!(out = ft_strnew(sizeof(char) * (len + i + 1))))
return (NULL);
ft_strcat(out, sstr[0]);
ft_strcpy(out, sstr[0]);
i = 1;
while (sstr[i])
{
ft_strcat(out, (char[]){sep, 0});
ft_strcat(out, sstr[i]);
ft_strcat(out, sstr[i++]);
}
return (out);
}