summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_printf_cat_output.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-09-29 19:18:30 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-09-29 19:18:30 +0200
commit4ede84d4ab98c75ed8655607fe64c205b79ed986 (patch)
tree6f9d5113400faf13a778de0f09c0203c7939b93f /libft/src/ft_printf_cat_output.c
parentNorm update (diff)
download42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.tar.gz
42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.tar.bz2
42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.tar.xz
42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.tar.zst
42-minishell-4ede84d4ab98c75ed8655607fe64c205b79ed986.zip
libft norm in progress
Diffstat (limited to 'libft/src/ft_printf_cat_output.c')
-rw-r--r--libft/src/ft_printf_cat_output.c9
1 files changed, 4 insertions, 5 deletions
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 <stddef.h>
#include <unistd.h>
-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;
}