Skip to contentSkip to conversation

examples: fix CID 30704 negative loop bound

PATCH New Slawomir Mrozowicz 1 participant 1 message Apr 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples: fix CID 30704 negative loop bound

It fix coverity issue: CID 30704 (#1 of 1): Negative loop bound (NEGATIVE_RETURNS) 8. negative_returns: Using unsigned variable n_tokens in a loop exit condition.
Date: Thu, 14 Apr 2016 13:15:49 +0200
Message-Id: <[email protected]>
X-Mailer: git-send-email 1.9.1

Fixes de3cfa2c9823 ("sched: initial import")
---
 examples/qos_sched/args.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/qos_sched/args.c +1 -1
index 3e7fd08..7a98e5c 100644
@@ -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)
Signature · 11 lines
1.9.1

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.