Skip to content

Commit

Permalink
Fix undefined behaviour. (netdata#19116)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkalintiris authored Dec 2, 2024
1 parent a2b9731 commit bf8aa93
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/libnetdata/ebpf/ebpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1652,15 +1652,11 @@ int ebpf_disable_tracing_values(char *subsys, char *eventname)
*/
static uint32_t ebpf_select_pc_prefix()
{
long counter = 1;
uint32_t i;
for (i = 0; i < 128; i++) {
counter <<= 1;
if (counter < 0)
break;
}

return counter;
#if SIZE_OF_VOID_P == 4
return 32;
#else
return 64;
#endif
}

/**
Expand Down

0 comments on commit bf8aa93

Please sign in to comment.