diff --git a/Makefile b/Makefile index 876fac0..eb91318 100644 --- a/Makefile +++ b/Makefile @@ -6,13 +6,13 @@ # By: vmanzoni +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/03/01 13:24:35 by vmanzoni #+# #+# # -# Updated: 2019/04/18 12:27:12 by vmanzoni ### ########.fr # +# Updated: 2019/04/22 15:32:49 by vmanzoni ### ########.fr # # # # **************************************************************************** # NAME = fillit -OBJ_DIR = objs./ +OBJ_DIR = ./objs HEADER = fillit.h SRCS = main.c \ @@ -20,7 +20,8 @@ SRCS = main.c \ handle_errors.c \ parse_input.c \ get_smallest_square.c \ - print_fillit.c + print_fillit.c \ + add_to_list.c OBJS = $(SRCS:.c=.o) LIB = libft/ @@ -33,7 +34,7 @@ RM = rm -rf all: $(NAME) $(NAME): - make -C libft/ + make -C $(LIB) $(CC) $(CFLAGS) -I$(HEADER) -c $(SRCS) $(CC) -o $(NAME) $(OBJS) -L $(LIB) -lft mkdir $(OBJ_DIR) diff --git a/read_file.c b/read_file.c index 0afb78c..72f1e58 100644 --- a/read_file.c +++ b/read_file.c @@ -6,7 +6,7 @@ /* By: vmanzoni +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/04/13 12:09:46 by vmanzoni #+# #+# */ -/* Updated: 2019/04/19 12:50:32 by hulamy ### ########.fr */ +/* Updated: 2019/04/22 15:16:18 by vmanzoni ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,12 +29,9 @@ char *read_file(char *file) || !(result = malloc(sizeof(char) * rv))) return (NULL); buf[rv] = '\0'; - i = 0; - while (buf[i]) - { + i = -1; + while (buf[++i]) result[i] = buf[i]; - i++; - } result[i] = '\0'; close(fd); return (result);