/**********************************************

* convert uint8_t to uint32_t
*
************************************************/
enum { T_MAX = 2147483647 };
uint32_t uatoi(const uint8_t * str)
{
    if(!str) return 0;
 
    uint32_t result = 0;
 
    while('0'<= *str && *str <= '9'){
uint32_t digit = *str - '0';
if( (result > INT_MAX /10) ||
(result == INT_MAX /10 && digit > INT_MAX ))
return INT_MAX;
        result = result*10 + digit;
str++;
    }
return result;
}