Cleaned the seg faults and normed the code, only

lm_mem_utils has a norm error.
This commit is contained in:
Mthandazo Ndhlovu
2019-05-06 08:05:37 +02:00
parent a40b6b00e7
commit a21860983e
14 changed files with 139 additions and 10737 deletions

View File

@@ -6,7 +6,7 @@
/* By: mndhlovu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/04 09:24:45 by mndhlovu #+# #+# */
/* Updated: 2019/05/02 13:12:06 by mndhlovu ### ########.fr */
/* Updated: 2019/05/06 07:25:00 by mndhlovu ### ########.fr */
/* */
/* ************************************************************************** */
@@ -21,7 +21,7 @@ static int lm_check_ant_no(char *line)
{
if (len == 1 && ft_isdigit(*line))
return (*line - '0');
else if (len > 1 && len < 19 && ft_isnumeric(line))
else if (len > 1 && lm_error_nbr(line) && ft_isnumeric(line))
return (ft_atoi(line));
}
return (0);
@@ -34,33 +34,33 @@ int lm_get_value(char *line)
return (0);
}
void lm_get_cmd_vertices(int count, t_syntax *synt
void lm_get_cmd_vertices(int count, t_holder *holder
, t_lmdata *ldata, char *line)
{
if (count > 0 && line != NULL)
{
lm_check_start_vert(count, synt, ldata, line);
lm_check_end_vert(count, synt, ldata, line);
lm_check_start_vert(count, holder, ldata, line);
lm_check_end_vert(count, holder, ldata, line);
}
}
void lm_get_vert_link(int count, t_lmdata *ldata
, t_syntax *syntax, t_holder *holder, char *line)
, t_holder *holder, char *line)
{
if (count > 0 && (count != syntax->s_vert
&& count != syntax->e_vert)
&& (count != syntax->s_pos
&& count != syntax->e_pos && line != NULL))
if (count > 0 && (count != holder->s_vert
&& count != holder->e_vert)
&& (count != holder->s_pos
&& count != holder->e_pos && line != NULL))
{
if (lm_check_forbiden_chars(line, 0))
{
if (!(lm_add_vertex(ldata, line, 'v', syntax)))
syntax->v_error = 1;
if (!(lm_add_vertex(ldata, line, 'v', holder)))
holder->v_error = 1;
}
if (lm_check_forbiden_chars(line, 3))
{
if (!(lm_ext_conn(holder, ldata, line)))
syntax->l_error = 1;
holder->l_error = 1;
}
}
}