Skip to content

Commit

Permalink
kickout all DST items if they are all in the past
Browse files Browse the repository at this point in the history
  • Loading branch information
fessehaeve committed Jun 29, 2023
1 parent 23dd47e commit e57c01e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,12 @@ TimeState TimeSynchronizationServer::UpdateDSTOffsetState()
}
if (!dstList[activeDstIndex].validUntil.IsNull() && dstList[activeDstIndex].validUntil.Value() <= chipEpochTime)
{
if (mDstOffsetObj.validSize == 1) // last item in the list
if (activeDstIndex + 1 >= mDstOffsetObj.validSize) // last item in the list
{
VerifyOrReturnValue(ClearDSTOffset() == CHIP_NO_ERROR, TimeState::kInvalid);
return TimeState::kInvalid;
}
dstList[activeDstIndex].offset = 0;
dstList[activeDstIndex].offset = 0; // not using dst and last DST item in the list is not active yet
return TimeState::kStopped;
}
if (activeDstIndex > 0)
Expand Down

0 comments on commit e57c01e

Please sign in to comment.