Skip to content

Commit

Permalink
Reset eventCounter when a reader is removed
Browse files Browse the repository at this point in the history
The eventCounter counts the number of card events.
When a reader is removed this field should be reset so that the next
time the READER_STATE structure is reused (for another reader) the
eventCounter starts at 0.
  • Loading branch information
LudovicRousseau committed May 17, 2023
1 parent 45f621b commit 92080dc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/readerfactory.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,7 @@ void RFUnInitializeReader(READER_CONTEXT * rContext)
memset(rContext->readerState->cardAtr, 0,
sizeof(rContext->readerState->cardAtr));
rContext->readerState->readerState = 0;
rContext->readerState->eventCounter = 0;
rContext->readerState->readerSharing = 0;
rContext->readerState->cardAtrLength = READER_NOT_INITIALIZED;
rContext->readerState->cardProtocol = SCARD_PROTOCOL_UNDEFINED;
Expand Down

0 comments on commit 92080dc

Please sign in to comment.