From: Lukas Jiriste Date: Wed, 27 Sep 2023 13:52:34 +0000 (+0200) Subject: Null character is now counted as printed character for the purposes of padding. X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=fda5feb65fbe6e0eb31faf8daa2d14d561a02a17;p=42%2Fft_printf.git Null character is now counted as printed character for the purposes of padding. --- diff --git a/padding.c b/padding.c index 2551dfb..8f5278f 100644 --- a/padding.c +++ b/padding.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/09/05 11:25:46 by ljiriste #+# #+# */ -/* Updated: 2023/09/08 17:19:54 by ljiriste ### ########.fr */ +/* Updated: 2023/09/27 15:16:21 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -56,7 +56,7 @@ void create_padding(t_to_print *tp, t_conv conv) { size_t len; - len = ft_strlen(tp->main_part); + len = ft_strlen(tp->main_part) + (!tp->main_part[0] && conv.type == 'c'); if (conv.type == 's' || conv.type == 'c') tp->zero_pad = ft_strdup(""); else