summaryrefslogtreecommitdiffstats
path: root/libft/src/ft_printf_cat_output.c
diff options
context:
space:
mode:
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;
}