42_C_PISCINE/Rush/Rush02/ex00/ft_print_dicterror.c

36 lines
1.2 KiB
C
Raw Normal View History

2023-05-17 12:45:25 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_print_dicterror.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/31 21:30:19 by cchauvet #+# #+# */
/* Updated: 2022/07/31 21:30:21 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#include "rush02.h"
int ft_nbr_error(char *str)
{
int i;
i = -1;
while (str[++i] != ':')
{
if (!(str[i] >= '0' && str[i] <= '9') && str[i] != ' ')
return (0);
}
return (1);
}
int ft_print_dicterror(char *str)
{
if (ft_nbr_error(str) == 0)
{
return (0);
}
return (1);
}