diff --git a/Makefile b/Makefile index 2d0a9dd..2c7c0fd 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,12 @@ # By: achubuko +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2023/12/02 21:33:22 by achubuko #+# #+# # -# Updated: 2023/12/03 17:29:02 by achubuko ### ########.fr # +# Updated: 2023/12/07 19:30:21 by achubuko ### ########.fr # # # # **************************************************************************** # NAME=rush-02 -_CFLAGS = -Wall -Wextra -Werror +_CFLAGS = -Wall -Wextra -fsanitize=address CFLAGS = -g CFLAGS := $(_CFLAGS) $(CFLAGS) ##################################### @@ -20,7 +20,7 @@ CFLAGS := $(_CFLAGS) $(CFLAGS) # all: default rule # norme prerequisite is not mandatory -all: $(NAME) norme +all: $(NAME) # clean: Delete *.o for project and libraries clean: diff --git a/ex00/digits_to_words.c b/ex00/digits_to_words.c index 3cd31ef..5d2f1fd 100644 --- a/ex00/digits_to_words.c +++ b/ex00/digits_to_words.c @@ -13,4 +13,5 @@ void print_digit_words(char *str) { + ///TODO: } diff --git a/ex00/ft_open.c b/ex00/ft_open.c index eaa3ffb..cd3b58e 100644 --- a/ex00/ft_open.c +++ b/ex00/ft_open.c @@ -9,6 +9,7 @@ /* Updated: 2023/12/03 23:36:29 by achubuko ### ########.fr */ /* */ /* ************************************************************************** */ + #include "ft_open.h" t_file *ft_open(char *path) @@ -45,7 +46,7 @@ void ft_growbuffer(t_file *f, ssize_t grow) cur[pos] = 0; pos++; } - free(prev); + // free(prev); f->buffer = cur; } diff --git a/ex00/main.c b/ex00/main.c index 8d73edc..07e14cb 100644 --- a/ex00/main.c +++ b/ex00/main.c @@ -41,6 +41,13 @@ int main(int argc, char **argv) if (argc == 3) dict_update(d, argv[2]); chk = invalid_arg_num(argv[1]); + + t_file *file = ft_open(argv[1]); + + ft_buffer_line(file); + + printf("%s\n", file->buffer); + if (!chk) print_digit_words(argv[1]); else diff --git a/ex00/main.h b/ex00/main.h index efeaa15..45cb3f9 100644 --- a/ex00/main.h +++ b/ex00/main.h @@ -16,4 +16,6 @@ # include "digits_to_words.h" # include "ft_utils.h" # include "dict_struct.h" +#include "ft_open.h" + #endif