]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
tc: Use correct variable type for get_distribution() result
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 23 Nov 2011 21:15:19 +0000 (22:15 +0100)
committerStephen Hemminger <shemminger@vyatta.com>
Wed, 23 Nov 2011 22:46:24 +0000 (14:46 -0800)
get_distribution() returns an int.

cppcheck reported:
[tc/q_netem.c:243]: (style) Checking if unsigned variable 'dist_size' is less than zero.

The mismatch actually rendered the error checking
after get_distribution() ineffective.

Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
tc/q_netem.c

index 01639a870a3bc0b2709c7228671564c8188d320a..6dc40bd9550e20e30a9e3b10df8dc75954bab400 100644 (file)
@@ -125,7 +125,7 @@ static int get_ticks(__u32 *ticks, const char *str)
 static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
                           struct nlmsghdr *n)
 {
-       size_t dist_size = 0;
+       int dist_size = 0;
        struct rtattr *tail;
        struct tc_netem_qopt opt;
        struct tc_netem_corr cor;