Coverty error: Incorrect expression (PW.ASSIGN_WHERE_COMPARE_MEANT) 13/2313/2
authorOle Troan <ot@cisco.com>
Thu, 4 Aug 2016 08:19:17 +0000 (10:19 +0200)
committerDave Barach <openvpp@barachs.net>
Thu, 11 Aug 2016 19:41:39 +0000 (19:41 +0000)
While the code is correct (assignment was intended) I have rewritten
it for readability.

Change-Id: I5f6fd7d7377c3904e74de4edfd478322a75af612
Signed-off-by: Ole Troan <ot@cisco.com>
vnet/vnet/map/map.c

index cd32777..8236811 100644 (file)
@@ -1099,12 +1099,19 @@ map_params_reass_command_fn (vlib_main_t * vm, unformat_input_t * input,
 
   while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
     {
-      if (!unformat (line_input, "lifetime %u", &lifetime) &&
-         !unformat (line_input, "ht-ratio %lf", &ht_ratio) &&
-         !unformat (line_input, "pool-size %u", &pool_size) &&
-         !unformat (line_input, "buffers %llu", &buffers) &&
-         !((unformat (line_input, "ip4")) && (ip4 = 1)) &&
-         !((unformat (line_input, "ip6")) && (ip6 = 1)))
+      if (unformat (line_input, "lifetime %u", &lifetime))
+       ;
+      else if (unformat (line_input, "ht-ratio %lf", &ht_ratio))
+       ;
+      else if (unformat (line_input, "pool-size %u", &pool_size))
+       ;
+      else if (unformat (line_input, "buffers %llu", &buffers))
+       ;
+      else if (unformat (line_input, "ip4"))
+       ip4 = 1;
+      else if (unformat (line_input, "ip6"))
+       ip6 = 1;
+      else
        {
          unformat_free (line_input);
          return clib_error_return (0, "invalid input");