From e3a37f0ef57189e628b8e64f96abff56d9cb065a Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Fri, 21 Jun 2024 13:03:35 +0200 Subject: [PATCH] Improve formatting of ft_parsing_table_printf The token names in the output header are now limitedr to the column width. --- ft_parse/ft_parsing_table_print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ft_parse/ft_parsing_table_print.c b/ft_parse/ft_parsing_table_print.c index 141130c..2f6dd0e 100644 --- a/ft_parse/ft_parsing_table_print.c +++ b/ft_parse/ft_parsing_table_print.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/16 07:19:50 by ljiriste #+# #+# */ -/* Updated: 2024/06/20 12:51:30 by ljiriste ### ########.fr */ +/* Updated: 2024/06/21 12:20:22 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -79,7 +79,7 @@ void ft_parsing_table_print(t_parsing_table *table, i = 0; ft_printf("\n%-5s ", "State"); while (i < table->tokens.size) - ft_printf("%-*s ", column_width - 1, + ft_printf("%-*.*s ", column_width - 1, column_width - 1, ((t_token *)ft_vec_access(&table->tokens, i++))->type); ft_printf("\n"); i = 0; -- 2.30.2