Fix some sizeof and switch-case errors reported by CodeChecker

CodeChecker is a python application that collects reports from static analyzers like
clang-tidy, clangsa, cppcheck.
This commit is contained in:
Bartosz Podrygajlo
2024-10-07 09:35:24 +02:00
parent d8a6c5c9d5
commit 01066a3f0d
10 changed files with 14 additions and 19 deletions
+3 -10
View File
@@ -154,17 +154,10 @@ static inline uint16_t BIT_STRING_to_uint16(const BIT_STRING_t *asn) {
DevCheck ((asn->size > 0) && (asn->size <= 2), asn->size, 0, 0);
switch (asn->size) {
case 2:
result |= asn->buf[index++] << (8 - asn->bits_unused);
case 1:
result |= asn->buf[index] >> asn->bits_unused;
break;
default:
break;
if (asn->size == 2) {
result |= asn->buf[index++] << (8 - asn->bits_unused);
}
result |= asn->buf[index] >> asn->bits_unused;
return result;
}