deux putstr dans ftprintf et ftconvert pour tenter de comprendre l'erreur du freed

This commit is contained in:
Hugo LAMY
2020-03-08 19:19:30 +01:00
parent c79d28a2ce
commit 26b9cb69fb
3 changed files with 5 additions and 1 deletions

View File

@@ -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);

View File

@@ -1 +1 @@
%

View File

@@ -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")))