Improve formatting of ft_parsing_table_printf
authorLukas Jiriste <ljiriste@student.42prague.com>
Fri, 21 Jun 2024 11:03:35 +0000 (13:03 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Fri, 21 Jun 2024 11:03:35 +0000 (13:03 +0200)
The token names in the output header are now limitedr
to the column width.

ft_parse/ft_parsing_table_print.c

index 141130c5535a0a55988c4b73adac598c73ac7c94..2f6dd0e8382684fea5a6d846e8b56baea2607fa4 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <ljiriste@student.42prague.com>   +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   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;