From 4ede84d4ab98c75ed8655607fe64c205b79ed986 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 29 Sep 2020 19:18:30 +0200 Subject: libft norm in progress --- libft/src/ft_printf_cat_output.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libft/src/ft_printf_cat_output.c') diff --git a/libft/src/ft_printf_cat_output.c b/libft/src/ft_printf_cat_output.c index f340109..720fe5a 100644 --- a/libft/src/ft_printf_cat_output.c +++ b/libft/src/ft_printf_cat_output.c @@ -14,16 +14,15 @@ #include #include -void - ft_printf_cat_output(char *src, size_t len, t_printflist *pflist) +void ft_printf_cat_output(char *src, size_t len, t_printflist *pflist) { size_t dst_len; dst_len = pflist->fulllen; pflist->output = (char*)ft_nrealloc(pflist->output, - (dst_len + 1) * sizeof(char), - (dst_len + len + 1) * sizeof(char)); - ft_memcpy(pflist->output + dst_len, src, len); + (dst_len + 1) * sizeof(char), + (dst_len + len + 1) * sizeof(char)); + (void)ft_memcpy(pflist->output + dst_len, src, len * sizeof(char)); *(pflist->output + dst_len + len) = '\0'; pflist->fulllen += len; } -- cgit v1.2.3