fractol/libft/src/ft_atou.c

31 lines
1.1 KiB
C
Raw Normal View History

2023-03-01 04:36:42 +01:00
/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_atou.c :+: :+: :+: */
/* +:+ */
/* By: djonker <marvin@codam.nl> +#+ */
/* +#+ */
/* Created: 2020/11/01 19:08:11 by djonker #+# #+# */
/* Updated: 2023/02/07 00:36:46 by houtworm ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft.h"
unsigned long long ft_atou(char *str)
{
unsigned long long r;
int c;
r = 0;
c = 0;
while ((str[c] == 32) || (str[c] > 8 && str[c] < 14))
c++;
while (str[c] >= '0' && str[c] <= '9')
{
r = 10 * r + (str[c] - '0');
c++;
}
return (r);
}