mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 11:05:08 -05:00
fix undefined shift operations on signed integers
This commit is contained in:
@@ -414,7 +414,7 @@ SRC_UpdateReachability(SRC_Instance inst, int reachable)
|
||||
{
|
||||
inst->reachability <<= 1;
|
||||
inst->reachability |= !!reachable;
|
||||
inst->reachability &= ~(-1 << SOURCE_REACH_BITS);
|
||||
inst->reachability %= 1U << SOURCE_REACH_BITS;
|
||||
|
||||
if (inst->reachability_size < SOURCE_REACH_BITS)
|
||||
inst->reachability_size++;
|
||||
|
||||
Reference in New Issue
Block a user