Skip to content

Commit cb8ea33

Browse files
author
Julien AZOUZ
committed
leak asm/gnl cas special
1 parent 956487f commit cb8ea33

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

asm/srcs/lexer/is_command.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* is_command.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: mbakhti <mbakhti@student.42.fr> +#+ +:+ +#+ */
6+
/* By: juazouz <juazouz@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2018/11/02 02:49:48 by mbakhti #+# #+# */
9-
/* Updated: 2019/03/08 19:14:22 by mbakhti ### ########.fr */
9+
/* Updated: 2019/04/10 15:16:04 by juazouz ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -17,7 +17,7 @@ _Bool is_command(char *tok, char next, t_pos cursor)
1717
if (ft_strchr(" \"\t\n\0", next))
1818
{
1919
if (ft_strequ(NAME_CMD_STRING, tok)
20-
|| ft_strequ(COMMENT_CMD_STRING, tok))
20+
|| ft_strequ(COMMENT_CMD_STRING, tok))
2121
return (true);
2222
}
2323
return (false);

asm/srcs/lexer/is_register.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* is_register.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: mbakhti <mbakhti@student.42.fr> +#+ +:+ +#+ */
6+
/* By: juazouz <juazouz@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2018/11/02 02:49:48 by mbakhti #+# #+# */
9-
/* Updated: 2019/03/08 19:14:17 by mbakhti ### ########.fr */
9+
/* Updated: 2019/04/10 15:16:00 by juazouz ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -17,7 +17,7 @@ _Bool is_register(char *tok, char next, t_pos cursor)
1717
size_t i;
1818

1919
if (!ft_isdigit(next) || next == SEPARATOR_CHAR
20-
|| ft_strchr(" \t\n\0", next))
20+
|| ft_strchr(" \t\n\0", next))
2121
{
2222
if (ft_strlen(tok) > 1 && tok[0] == 'r' && ft_strlen(tok) < 4)
2323
{

asm/srcs/store_assembly.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/* ::: :::::::: */
44
/* store_assembly.c :+: :+: :+: */
55
/* +:+ +:+ +:+ */
6-
/* By: mbakhti <mbakhti@student.42.fr> +#+ +:+ +#+ */
6+
/* By: juazouz <juazouz@student.42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2018/10/25 21:30:19 by mbakhti #+# #+# */
9-
/* Updated: 2019/04/01 10:41:50 by mbakhti ### ########.fr */
9+
/* Updated: 2019/04/03 13:44:18 by juazouz ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -42,7 +42,10 @@ void store_assembly(char **instructions, char *filename)
4242
while ((ret = get_next_line(fd, &line)))
4343
{
4444
if (ret < 0)
45+
{
4546
ft_exit_error("error: can't read sourcefile");
47+
ft_strdel(&line);
48+
}
4649
concat_line(instructions, line);
4750
ft_strdel(&line);
4851
}

0 commit comments

Comments
 (0)