/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strisdigit.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/06/16 16:16:37 by bchanot #+# #+# */ /* Updated: 2018/10/14 03:26:30 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" int ft_strisdigit(const char *src) { t_bool end; end = false; if (!src) return (false); while (*src && *src == ' ') src++; if (*src == '-' || *src == '+') src++; while (*src) { if ((*src >= 48 && *src <= 57) && !end) src++; else if (*src == ' ' && !end) end = true; else return (false); } return (true); }