From 60aa0dc68431ba5c6b8ced1d58d16d929825418c Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Sun, 16 Jun 2024 07:16:08 +0200 Subject: [PATCH] Fix interpretting the end of row as 0 --- ft_parse/ft_parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ft_parse/ft_parse.c b/ft_parse/ft_parse.c index ca4180c..6903469 100644 --- a/ft_parse/ft_parse.c +++ b/ft_parse/ft_parse.c @@ -6,7 +6,7 @@ /* By: ljiriste +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/05/20 20:51:36 by ljiriste #+# #+# */ -/* Updated: 2024/06/15 14:32:50 by ljiriste ### ########.fr */ +/* Updated: 2024/06/16 07:15:38 by ljiriste ### ########.fr */ /* */ /* ************************************************************************** */ @@ -169,7 +169,9 @@ static int add_line(t_vec *states, const char *line, size_t lookahead_size) while (condensed_line[i]) { while (condensed_line[i] && condensed_line[i++] != ';'); - if (condensed_line[i] == ';') + if (!condensed_line[i]) + break ; + else if (condensed_line[i] == ';') goto_rule = -1; else goto_rule = ft_atoi(condensed_line + i); -- 2.30.2