ifconfig: Shift unsigned value to avoid UB.
Reported by: kib@
This commit is contained in:
@@ -88,7 +88,7 @@ print_bits(const char *btype, uint32_t *v, const int v_count,
|
|||||||
int num = 0;
|
int num = 0;
|
||||||
|
|
||||||
for (int i = 0; i < v_count * 32; i++) {
|
for (int i = 0; i < v_count * 32; i++) {
|
||||||
bool is_set = v[i / 32] & (1 << (i % 32));
|
bool is_set = v[i / 32] & (1U << (i % 32));
|
||||||
if (is_set) {
|
if (is_set) {
|
||||||
if (num++ == 0)
|
if (num++ == 0)
|
||||||
printf("<");
|
printf("<");
|
||||||
|
|||||||
Reference in New Issue
Block a user