src/cmd/utils/cmd_read_num.c
/*
** cmd_read_uint() moves source to end of num
** returns  0 on success
** returns -1 on error
** returns  1 on warning
*/
cmd_read_uint() moves source to end of num
returns  0 on success
returns -1 on error
returns  1 on warning
cmd_read_uint () moves source to end of num returns 0 on success returns - 1 on error returns 1 on warning
int			cmd_read_uint(char **source, uint *num)
{
	int			res;
	char		*ptr;
	if (source == NULL || num == NULL)
		return (rt_err("Arguments are NULL"));
	if ((ptr = *source) == NULL)
		return (rt_err("Dereference to NULL pointer"));
	if ((res = ft_atoi(ptr)) <= 0)
		return (rt_warning("Bad uint", 1));
	*num = (uint)res;
	while (ft_isnum(*ptr))
		ptr++;
	*source = ptr;
	return (0);
}
int cmd_read_uint ( char * * source , uint * num ) { int res ; char * ptr ; if ( source == NULL || num == NULL ) return ( rt_err ( " " ) ) ; if ( ( ptr = * source ) == NULL ) return ( rt_err ( " " ) ) ; if ( ( res = ft_atoi ( ptr ) ) <= 0 ) return ( rt_warning ( " " , 1 ) ) ; * num = ( uint ) res ; while ( ft_isnum ( * ptr ) ) ptr ++ ; * source = ptr ; return ( 0 ) ; }
cmd_read_uint() moves source to end of num
returns  0 on success
returns -1 on error
returns  1 on warning
cmd_read_uint () moves source to end of num returns 0 on success returns - 1 on error returns 1 on warning