if (num_len < 3) *val *= 10; if (num_len < 2) *val *= 10;
if (!lead_zero) ASSERT(*val == 1000); else { if (num_len < 3) *val *= 10; if (num_len < 2) *val *= 10; }
static int http_parse_quality(Vstr_base *data,                              size_t *passed_pos, size_t *passed_len,                              int allow_more, unsigned int *val){  size_t pos = *passed_pos;  size_t len = *passed_len;    ASSERT(val);    *val = 1000;    HTTP_SKIP_LWS(data, pos, len);  *passed_pos = pos;  *passed_len = len;    if (!len || VPREFIX(data, pos, len, ","))    return (TRUE);  else if (VPREFIX(data, pos, len, ";"))  {    int lead_zero = FALSE;    unsigned int num_len = 0;    unsigned int parse_flags = VSTR_FLAG02(PARSE_NUM, NO_BEG_PM, NO_NEGATIVE);        len -= 1; pos += 1;    HTTP_SKIP_LWS(data, pos, len);        if (!VPREFIX(data, pos, len, "q"))      return (!!allow_more);        len -= 1; pos += 1;    HTTP_SKIP_LWS(data, pos, len);        if (!VPREFIX(data, pos, len, "="))      return (!!allow_more);        len -= 1; pos += 1;    HTTP_SKIP_LWS(data, pos, len);    /* if it's 0[.00?0?] TRUE, 0[.\d\d?\d?] or 1[.00?0?] is FALSE */    if (!(lead_zero = VPREFIX(data, pos, len, "0")) &&        !VPREFIX(data, pos, len, "1"))      return (FALSE);    *val = (!lead_zero) * 1000;        len -= 1; pos += 1;        HTTP__PARSE_CHK_RET_OK();    if (!VPREFIX(data, pos, len, "."))      return (FALSE);        len -= 1; pos += 1;    HTTP_SKIP_LWS(data, pos, len);    *val += vstr_parse_uint(data, pos, len, 10 | parse_flags, &num_len, NULL);    if (!num_len || (num_len > 3) || (*val > 1000))      return (FALSE);    if (num_len < 3) *val *= 10;    if (num_len < 2) *val *= 10;    ASSERT(*val <= 1000);        len -= num_len; pos += num_len;        HTTP__PARSE_CHK_RET_OK();  }    return (FALSE);}