1
0
mirror of https://github.com/CovidBraceletPrj/CovidBracelet.git synced 2024-12-05 00:55:43 +01:00

Update src/ens/sequencenumber.c

Support equal values of older and newer
This commit is contained in:
Patrick Rathje 2021-05-25 17:50:11 +02:00
parent bb6be05d53
commit a87c8928c2

View File

@ -20,9 +20,9 @@ record_sequence_number_t sn_increment_by(record_sequence_number_t sn, uint32_t a
}
record_sequence_number_t sn_get_middle_sn(record_sequence_number_t older, record_sequence_number_t newer) {
if (older < newer) {
if (older <= newer) {
return GET_MASKED_SN(((older + newer) / 2));
} else {
return GET_MASKED_SN(((older + newer + SN_MASK) / 2));
}
}
}