Skip to content

Commit

Permalink
[C] Make sure clamping method actually uses the parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Jan 30, 2022
1 parent f7d7829 commit 7e3191e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aeron-driver/src/main/c/aeron_driver_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -2600,8 +2600,8 @@ int aeron_driver_context_bindings_clientd_find(aeron_driver_context_t *context,
static uint32_t aeron_driver_context_clamp_value(uint32_t value, uint32_t min, uint32_t max)
{
uint32_t clamped_value;
clamped_value = value > AERON_DRIVER_RECEIVER_IO_VECTOR_LENGTH_MAX ? AERON_DRIVER_RECEIVER_IO_VECTOR_LENGTH_MAX : value;
clamped_value = clamped_value < 1 ? 1 : clamped_value;
clamped_value = value > max ? max : value;
clamped_value = clamped_value < min ? min : clamped_value;

return clamped_value;
}
Expand Down

0 comments on commit 7e3191e

Please sign in to comment.