2 files changed, +7, -9
62b55a8fix set_value not incrementing string after reading it. also fixed position of return. NOW it works as the previous previous commit
parsers/parse_format.c
+4, -7
parsers/parse_utils.c
+3, -2
+4, -7
@@ -6,12 +6,11 @@
6 6 /* By: mleitao <mleitao@student.42.fr> +#+ +:+ +#+ */
7 7 /* +#+#+#+#+#+ +#+ */
8 8 /* Created: 2026/03/30 17:45:38 by mleitao #+# #+# */
9 -/* Updated: 2026/03/31 00:36:28 by mleitao ### ########.fr */
9+/* Updated: 2026/03/31 00:56:51 by mleitao ### ########.fr */
1010 /* */
1111 /* ************************************************************************** */
1212
1313 #include <parsers.h>
14 -
1514 /*
1615 static void print_format(t_format *format)
1716 {
@@ -23,7 +22,8 @@ static void print_format(t_format *format)
2322 printf("width -> %d\n", format->width);
2423 printf("precision -> %d\n", format->precision);
2524 printf("spec -> %c\n", format->spec);
26 -} */
25+}
26+*/
2727
2828 int parse_format(t_data *d)
2929 {
@@ -36,10 +36,7 @@ int parse_format(t_data *d)
3636 if (*d->fmt == '.')
3737 {
3838 d->fmt++;
39 - if (!in(NUMBERS, *d->fmt) && *d->fmt != '*')
40 - d->format.precision = 0;
41 - else
42 - set_value(d, &d->format.precision);
39+ set_value(d, &d->format.precision);
4340 }
4441 set_specifier(d);
4542 if (!d->format.spec)
+3, -2
@@ -6,7 +6,7 @@
6 6 /* By: mleitao <mleitao@student.42.fr> +#+ +:+ +#+ */
7 7 /* +#+#+#+#+#+ +#+ */
8 8 /* Created: 2026/03/30 18:11:57 by mleitao #+# #+# */
9 -/* Updated: 2026/03/31 00:37:03 by mleitao ### ########.fr */
9+/* Updated: 2026/03/31 00:52:53 by mleitao ### ########.fr */
1010 /* */
1111 /* ************************************************************************** */
1212
@@ -48,8 +48,9 @@ void set_value(t_data *d, int *n)
4848 {
4949 d->format.minus = 1;
5050 *n = -*n;
51 - return ;
5251 }
52+ d->fmt++;
53+ return ;
5354 }
5455 *n = 0;
5556 while (ft_isdigit(*d->fmt))