Trying to trace the source of the segfault

I will breakdown the parser for a slight moment then relink it.
This commit is contained in:
Mthandazo Ndhlovu
2019-04-22 16:00:16 +02:00
parent a8b2e31701
commit c35deace58
15 changed files with 93 additions and 209 deletions

View File

@@ -6,7 +6,7 @@
/* By: mndhlovu <mndhlovu@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/22 08:55:30 by mndhlovu #+# #+# */
/* Updated: 2019/04/22 09:55:46 by mndhlovu ### ########.fr */
/* Updated: 2019/04/22 12:43:44 by mndhlovu ### ########.fr */
/* */
/* ************************************************************************** */
@@ -30,16 +30,23 @@ int lm_check_forbiden_chars(char *line, int flag)
char *hash;
char *dash;
dash = ft_strchr(line, '-');
hash = ft_strchr(line, '#');
if (flag == 0 && dash == NULL && hash == NULL)
return (1);
if (flag == 1 && dash == NULL && hash != NULL)
return (1);
if (flag == 2 && dash == NULL && (hash == NULL || (hash != NULL && line[1] != '#')))
return (1);
if (flag == 3 && dash != NULL && (hash == NULL || (hash != NULL && line[1] != '#')))
return (1);
if (line != NULL)
{
dash = ft_strchr(line, '-');
hash = ft_strchr(line, '#');
if (flag == 0 && dash == NULL
&& hash == NULL)
return (1);
if (flag == 1 && dash == NULL
&& hash != NULL)
return (1);
if (flag == 2 && dash == NULL
&& (hash == NULL || (hash != NULL && line[1] != '#')))
return (1);
if (flag == 3 && dash != NULL
&& (hash == NULL || (hash != NULL && line[1] != '#')))
return (1);
}
return (0);
}