second and, maybe, last commit

This commit is contained in:
Gregory Tertyshny 2016-12-26 19:32:47 +02:00
parent d1cabbc8d5
commit 50c660a9d6
5 changed files with 24 additions and 12 deletions

View file

@ -6,7 +6,7 @@
# By: gtertysh <marvin@42.fr> +#+ +:+ +#+ # # By: gtertysh <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2016/12/14 16:54:48 by gtertysh #+# #+# # # Created: 2016/12/14 16:54:48 by gtertysh #+# #+# #
# Updated: 2016/12/23 19:59:53 by gtertysh ### ########.fr # # Updated: 2016/12/26 19:11:43 by gtertysh ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
@ -51,19 +51,22 @@ CC = clang
all: $(NAME) all: $(NAME)
$(NAME): $(OBJ) $(LIBFOLDER)$(LIB) $(NAME): $(OBJ) $(LIBFOLDER)$(LIB) $(OBJDIR)
$(CC) $(FLAGS) $(OBJ) $(LIBFLAGS) -o $(NAME) $(CC) $(FLAGS) $(OBJ) $(LIBFLAGS) -o $(NAME)
$(OBJDIR)%.o : $(SRCDIR)%.c $(OBJDIR)%.o : $(SRCDIR)%.c
$(CC) $(FLAGS) $(INC) -c $< -o $@ $(CC) $(FLAGS) $(INC) -c $< -o $@
$(OBJDIR):
mkdir $(OBJDIR)
$(LIBFOLDER)$(LIB): $(LIBFOLDER)$(LIB):
make -C $(LIBFOLDER) make -C $(LIBFOLDER)
clean: clean: libclean
rm -rf $(OBJ) rm -rf $(OBJ)
fclean: clean fclean: clean libfclean
rm -rf $(NAME) rm -rf $(NAME)
libclean: libclean:
@ -72,4 +75,4 @@ libclean:
libfclean: libfclean:
make fclean -C $(LIBFOLDER) make fclean -C $(LIBFOLDER)
re: fclean libfclean all re: clean all

1
auteur Normal file
View file

@ -0,0 +1 @@
gtertysh:ykolomie

View file

@ -1 +0,0 @@
gtertysh

View file

View file

@ -6,7 +6,7 @@
/* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */ /* By: gtertysh <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/26 15:30:15 by gtertysh #+# #+# */ /* Created: 2016/12/26 15:30:15 by gtertysh #+# #+# */
/* Updated: 2016/12/26 15:30:19 by gtertysh ### ########.fr */ /* Updated: 2016/12/26 19:31:18 by gtertysh ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -15,14 +15,21 @@
void check_endline(char *str) void check_endline(char *str)
{ {
int i; int i;
int hashes;
i = 4; hashes = 0;
i = 0;
while (i < 20) while (i < 20)
{ {
if (!(str[i] == '\n')) if (str[i] == '#')
error(); hashes++;
i += 5; if ((i + 1) % 5 == 0)
if (str[i] != '\n')
error();
i++;
} }
if (hashes != 4)
error();
} }
void check_char(char ch) void check_char(char ch)
@ -38,6 +45,8 @@ void check_string(char *string_ttrs)
i = 0; i = 0;
j = 0; j = 0;
if (string_ttrs[0] == '\0')
error();
while (string_ttrs[i]) while (string_ttrs[i])
{ {
check_char(string_ttrs[i]); check_char(string_ttrs[i]);