From 26b9cb69fb53b5e5e5c813e5c462d6eab2c1452c Mon Sep 17 00:00:00 2001 From: Hugo LAMY Date: Sun, 8 Mar 2020 19:19:30 +0100 Subject: [PATCH] deux putstr dans ftprintf et ftconvert pour tenter de comprendre l'erreur du freed --- ft_printf.c | 1 + outft.txt | 2 +- srcs/ft_convert.c | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ft_printf.c b/ft_printf.c index 3bdfa27..81b69b1 100644 --- a/ft_printf.c +++ b/ft_printf.c @@ -108,6 +108,7 @@ char *convert_with_flags(char *s, va_list ap, char *type, int *size) return (NULL); if (!(print = ft_flag_transform(s, print, type, size))) return (NULL); +// ft_putstr(s); free(s); s = print; return (print); diff --git a/outft.txt b/outft.txt index 8b13789..314d73b 100644 --- a/outft.txt +++ b/outft.txt @@ -1 +1 @@ - +% diff --git a/srcs/ft_convert.c b/srcs/ft_convert.c index 0af8cb9..cead580 100644 --- a/srcs/ft_convert.c +++ b/srcs/ft_convert.c @@ -81,7 +81,10 @@ char *ft_convert(va_list ap, char *type, char **s) if ((tmp = ft_strchrset(type, "dic")) && ft_strchr(type, 'l')) return (conv_i(tmp[0], va_arg(ap, long int))); if ((tmp = ft_strchrset(type, "dic"))) + { +// ft_putstr("OK"); return (conv_i(tmp[0], va_arg(ap, int))); + } if ((tmp = ft_strchrset(type, "uxXps")) && ft_strchrset(type, "lps")) return (conv_u(tmp[0], va_arg(ap, unsigned long int))); if ((tmp = ft_strchrset(type, "uxX")))