*posp += (pattern - *patternp);
if((rc != 2) || (min_c >= max_c) || ((max_c - min_c) > ('z' - 'a')) ||
- (step < 0) )
+ (step <= 0) )
/* the pattern is not well-formed */
return GLOBERROR("bad range", *posp, CURLE_URL_MALFORMAT);
pat->content.CharRange.max_c = max_c;
if(multiply(amount, (pat->content.CharRange.max_c -
- pat->content.CharRange.min_c + 1)))
+ pat->content.CharRange.min_c) /
+ pat->content.CharRange.step + 1) )
return GLOBERROR("range overflow", *posp, CURLE_URL_MALFORMAT);
}
else if(ISDIGIT(*pattern)) {
*posp += (pattern - *patternp);
- if(!endp || (min_n > max_n) || (step_n > (max_n - min_n)))
+ if(!endp || (min_n > max_n) || (step_n > (max_n - min_n)) ||
+ (step_n <= 0) )
/* the pattern is not well-formed */
return GLOBERROR("bad range", *posp, CURLE_URL_MALFORMAT);
pat->content.NumRange.step = step_n;
if(multiply(amount, (pat->content.NumRange.max_n -
- pat->content.NumRange.min_n + 1)))
+ pat->content.NumRange.min_n) /
+ pat->content.NumRange.step + 1) )
return GLOBERROR("range overflow", *posp, CURLE_URL_MALFORMAT);
}
else
*result = target;
return CURLE_OK;
}
-