Fixed more alert found by PVS-Studio

This commit is contained in:
hathach
2025-11-03 16:36:07 +07:00
parent 22f01aea0d
commit 8979af34c0
25 changed files with 224 additions and 208 deletions

View File

@ -165,7 +165,7 @@ static inline size_t board_usb_get_serial(uint16_t desc_str1[], size_t max_chars
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
};
const uint8_t nibble = (uint8_t) ((uid[i] >> (j * 4)) & 0xf);
const uint8_t nibble = (uint8_t) ((uid[i] >> (j * 4u)) & 0xfu);
desc_str1[i * 2 + (1 - j)] = nibble_to_hex[nibble]; // UTF-16-LE
}
}