src/cmd/utils/cmd_read_num.c
/*
** cmd_read_num() moves source to end of num
** returns 0 on success
*/
cmd_read_num() moves source to end of num
returns 0 on success
cmd_read_num () moves source to end of num returns 0 on success
int			cmd_read_num(char **source, t_num *num)
{
	char		*ptr;
	if (source == NULL)
		return (rt_err("Arguments are NULL"));
	if ((ptr = *source) == NULL)
		return (rt_err("Dereference to NULL pointer"));
	if (!ft_isnum(*ptr))
		return (-1);
	*num = (t_num)ft_atod(ptr);
	while (ft_isnum(*ptr))
		ptr++;
	*source = ptr;
	return (0);
}
int cmd_read_num ( char * * source , t_num * num ) { char * ptr ; if ( source == NULL ) return ( rt_err ( " " ) ) ; if ( ( ptr = * source ) == NULL ) return ( rt_err ( " " ) ) ; if ( ! ft_isnum ( * ptr ) ) return ( -1 ) ; * num = ( t_num ) ft_atod ( ptr ) ; while ( ft_isnum ( * ptr ) ) ptr ++ ; * source = ptr ; return ( 0 ) ; }
cmd_read_num() moves source to end of num
returns 0 on success
cmd_read_num () moves source to end of num returns 0 on success