all flags setup, some fixes is needed

This commit is contained in:
David Gailleton
2025-11-20 16:54:00 +01:00
parent bd1c66d86f
commit 24887c810c
12 changed files with 181 additions and 63 deletions

View File

@@ -6,21 +6,21 @@
/* By: dgaillet <dgaillet@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/17 12:26:23 by dgaillet #+# #+# */
/* Updated: 2025/11/19 20:56:30 by dgaillet ### ########lyon.fr */
/* Updated: 2025/11/20 16:17:12 by dgaillet ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include "ft_printf_bonus.h"
#include <unistd.h>
int print_unsigned(t_arg *arg, unsigned long nbr)
int print_unsigned(t_arg *arg, unsigned int nbr)
{
int count;
count = 0;
if (nbr == 0)
count += write(1, "0", 1);
count += print_chars(arg->padding - nbr_size_base(nbr, 10), ' ');
count += print_chars(arg->zero - nbr_size_base(nbr, 10), '0');
count += print_chars(arg->dot - nbr_size_base(nbr, 10), '0');
count += ft_putnbr_base(nbr, "0123456789", 10);
return (count);
}