From fe24a254415b38952eeef8f0ca4e830549360850 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 20 Apr 2020 22:24:25 +0200 Subject: Pretty good start --- src/ft_p_line.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/ft_p_line.c') diff --git a/src/ft_p_line.c b/src/ft_p_line.c index ddaf0bd..606408b 100644 --- a/src/ft_p_line.c +++ b/src/ft_p_line.c @@ -21,14 +21,21 @@ void ft_p_line(char line[], t_msh *msh) { - int64_t ret; + uint64_t i; + uint64_t count; - if ((ret = ft_strlchr(line, ';') < 0)) + i = 0; + count = 0; + while (line[i] != '\0') { - if (ft_p_lcom(line, 1, msh) < 0) + if (line[i] == ';') { - exit(FT_RET_ALLOC); + count++; } + i++; + } + if (ft_p_lcom(line, count, msh) < 0) + { + exit(FT_RET_ALLOC); } - /* TODO: fun */ } -- cgit v1.2.3