examples/qos_sched: fix negative loop bound in option parsing

negative_returns: Using unsigned variable n_tokens in a loop exit condition.

Coverity issue: 30704
Fixes: de3cfa2c98 ("sched: initial import")

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
This commit is contained in:
Slawomir Mrozowicz 2016-04-21 15:08:11 +02:00 committed by Thomas Monjalon
parent 035b6a4f4b
commit cb9234082a

View File

@ -162,7 +162,7 @@ static int
app_parse_opt_vals(const char *conf_str, char separator, uint32_t n_vals, uint32_t *opt_vals)
{
char *string;
uint32_t i, n_tokens;
int i, n_tokens;
char *tokens[MAX_OPT_VALUES];
if (conf_str == NULL || opt_vals == NULL || n_vals == 0 || n_vals > MAX_OPT_VALUES)