erreur resolue dans precision

This commit is contained in:
Hugo LAMY
2020-03-09 14:19:44 +01:00
parent f4df40f992
commit 12d30893f8
6 changed files with 25 additions and 3 deletions
+11
View File
@@ -0,0 +1,11 @@
("%.i", 0) : '' [0]
JACKPOT : '' [0]
----------------------------------------------------------------
% flags width .precision length specifier
% 0-#' + * 0..9 .* 0..9 hhhlllLjtz diuxXcsp%efgnEFGaACSo
% 0- * 0..9 .* 0..9 diuxXcsp%
% #' + hhhlll efgn
----------------------------------------------------------------
-2
View File
@@ -108,9 +108,7 @@ char *convert_with_flags(char *s, va_list ap, char *type, int *size)
return (NULL); return (NULL);
if (!(print = ft_flag_transform(s, print, type, size))) if (!(print = ft_flag_transform(s, print, type, size)))
return (NULL); return (NULL);
// ft_putstr(s);
free(s); free(s);
s = print;
return (print); return (print);
} }
+1
View File
@@ -0,0 +1 @@
33333
+1
View File
@@ -0,0 +1 @@
33333
+1 -1
View File
@@ -66,7 +66,7 @@ char *ft_precision(char *s, char *print, char *type)
{ {
precision = ft_atoi(tmp + 1); precision = ft_atoi(tmp + 1);
*tmp = '\0'; *tmp = '\0';
while (ft_strchr("#- +'0", *(++s))) while (*s && ft_strchr("#- +'0", *(++s)))
if (*s == '0') if (*s == '0')
*s = '.'; *s = '.';
i = 0; i = 0;
+11
View File
@@ -0,0 +1,11 @@
("%.i", 0) : '' [0]
JACKPOT : '' [0]
----------------------------------------------------------------
% flags width .precision length specifier
% 0-#' + * 0..9 .* 0..9 hhhlllLjtz diuxXcsp%efgnEFGaACSo
% 0- * 0..9 .* 0..9 diuxXcsp%
% #' + hhhlll efgn
----------------------------------------------------------------