From 78390e5d8c80c81ce4128e2e7182978e51679d6a Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Mon, 12 Dec 2016 00:42:20 +0100 Subject: [PATCH] sstrcat fix --- libftasm/src/lst/ft_lst_find.c | 2 +- libftasm/src/sstr/ft_sstrcat.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libftasm/src/lst/ft_lst_find.c b/libftasm/src/lst/ft_lst_find.c index 140814e1..ef70f221 100644 --- a/libftasm/src/lst/ft_lst_find.c +++ b/libftasm/src/lst/ft_lst_find.c @@ -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; } diff --git a/libftasm/src/sstr/ft_sstrcat.c b/libftasm/src/sstr/ft_sstrcat.c index d0256754..313fc24d 100644 --- a/libftasm/src/sstr/ft_sstrcat.c +++ b/libftasm/src/sstr/ft_sstrcat.c @@ -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); }