This commit is contained in:
Aleksei Chubukov 2023-12-07 20:06:51 +04:00
parent b5efa9ea07
commit 1d9fc70142
5 changed files with 15 additions and 4 deletions

View File

@ -6,12 +6,12 @@
# By: achubuko <marvin@42.fr> +#+ +:+ +#+ # # By: achubuko <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2023/12/02 21:33:22 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 NAME=rush-02
_CFLAGS = -Wall -Wextra -Werror _CFLAGS = -Wall -Wextra -fsanitize=address
CFLAGS = -g CFLAGS = -g
CFLAGS := $(_CFLAGS) $(CFLAGS) CFLAGS := $(_CFLAGS) $(CFLAGS)
##################################### #####################################
@ -20,7 +20,7 @@ CFLAGS := $(_CFLAGS) $(CFLAGS)
# all: default rule # all: default rule
# norme prerequisite is not mandatory # norme prerequisite is not mandatory
all: $(NAME) norme all: $(NAME)
# clean: Delete *.o for project and libraries # clean: Delete *.o for project and libraries
clean: clean:

View File

@ -13,4 +13,5 @@
void print_digit_words(char *str) void print_digit_words(char *str)
{ {
///TODO:
} }

View File

@ -9,6 +9,7 @@
/* Updated: 2023/12/03 23:36:29 by achubuko ### ########.fr */ /* Updated: 2023/12/03 23:36:29 by achubuko ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "ft_open.h" #include "ft_open.h"
t_file *ft_open(char *path) t_file *ft_open(char *path)
@ -45,7 +46,7 @@ void ft_growbuffer(t_file *f, ssize_t grow)
cur[pos] = 0; cur[pos] = 0;
pos++; pos++;
} }
free(prev); // free(prev);
f->buffer = cur; f->buffer = cur;
} }

View File

@ -41,6 +41,13 @@ int main(int argc, char **argv)
if (argc == 3) if (argc == 3)
dict_update(d, argv[2]); dict_update(d, argv[2]);
chk = invalid_arg_num(argv[1]); chk = invalid_arg_num(argv[1]);
t_file *file = ft_open(argv[1]);
ft_buffer_line(file);
printf("%s\n", file->buffer);
if (!chk) if (!chk)
print_digit_words(argv[1]); print_digit_words(argv[1]);
else else

View File

@ -16,4 +16,6 @@
# include "digits_to_words.h" # include "digits_to_words.h"
# include "ft_utils.h" # include "ft_utils.h"
# include "dict_struct.h" # include "dict_struct.h"
#include "ft_open.h"
#endif #endif