From: Lukas Jiriste Date: Sun, 16 Jun 2024 05:16:08 +0000 (+0200) Subject: Fix interpretting the end of row as 0 X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=60aa0dc68431ba5c6b8ced1d58d16d929825418c;p=Libft.git Fix interpretting the end of row as 0 --- 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);