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> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# 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:

View File

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

View File

@ -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;
}

View File

@ -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

View File

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