style: error message are now in red

This commit is contained in:
Raphael 2024-10-31 11:57:45 +01:00
parent 66a523d4b5
commit f48e586896
5 changed files with 38 additions and 8 deletions

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/30 16:41:32 by rparodi #+# #+# */
/* Updated: 2024/10/31 10:37:56 by rparodi ### ########.fr */
/* Updated: 2024/10/31 11:23:05 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
@ -24,9 +24,9 @@
bool ft_parse_args(int argc, char *argv[])
{
if (argc != 2)
return (write(2, ERR_ARGS_COUNT, strlen(ERR_ARGS_COUNT)), false);
return (print_error(ERR_ARGS_COUNT), false);
if (strlen(argv[1]) < 4 || \
strcmp((argv[1] + (strlen(argv[1]) - 4)), ".cub") != 0)
return (write(2, INV_NAME_MAP, strlen(INV_NAME_MAP)), false);
return (print_error(INV_NAME_MAP), false);
return (true);
}