string_test: Coverity woe 59/17759/1
authorSteven Luong <sluong@cisco.com>
Thu, 21 Feb 2019 19:58:14 +0000 (11:58 -0800)
committerSteven Luong <sluong@cisco.com>
Thu, 21 Feb 2019 20:01:10 +0000 (12:01 -0800)
Coverity complains about dead code as shown below and it is right.
The fix is to simply remove the dead code.

503  if (v_indicator != indicator)

CID 190173 (#3 of 3): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: return -1;.
504    return -1;

Change-Id: Ibca9e10451a4459db099bef5ecc6939474bdb903
Signed-off-by: Steven Luong <sluong@cisco.com>
src/plugins/unittest/string_test.c

index cbceb8f..7e08bdf 100644 (file)
@@ -500,8 +500,6 @@ test_clib_strncmp (vlib_main_t * vm, unformat_input_t * input)
   v_indicator = strncmp (s1, "Every moment is a fresh beginning", s1len + 1);
   if (v_indicator != 0)
     return -1;
-  if (v_indicator != indicator)
-    return -1;
 
   /* unterminated s1 */
   s1[s1len] = 0x1;