vppinfra: strstr_s_inline checks string unterminated wrong
[vpp.git] / src / vppinfra / string.h
index 5d01e48..db09c50 100644 (file)
@@ -678,10 +678,7 @@ clib_count_equal_u8 (u8 * data, uword max_count)
       u64 bmp;
       bmp = u8x32_msb_mask ((u8x32) (u8x32_load_unaligned (data) == splat));
       if (bmp != 0xffffffff)
-       {
-         count += count_trailing_zeros (~bmp);
-         return max_count;
-       }
+       return max_count;
 
       data += 32;
       count += 32;
@@ -1398,7 +1395,7 @@ strstr_s_inline (char *s1, rsize_t s1max, const char *s2, rsize_t s2max,
        clib_c11_violation ("substring NULL");
       if (s1 && s1max && (s1[clib_strnlen (s1, s1max)] != '\0'))
        clib_c11_violation ("s1 unterminated");
-      if (s2 && s2max && (s2[clib_strnlen (s2, s1max)] != '\0'))
+      if (s2 && s2max && (s2[clib_strnlen (s2, s2max)] != '\0'))
        clib_c11_violation ("s2 unterminated");
       return EINVAL;
     }