Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix condition to eliminate TID overflow issue #2174

Merged
merged 1 commit into from
Apr 23, 2024
Merged

Fix condition to eliminate TID overflow issue #2174

merged 1 commit into from
Apr 23, 2024

Conversation

martyy665
Copy link
Contributor

Fix tid overflow issue when tid is zero.

These two snippets are NOT the same - the difference appears when the numeric variable reaches zero (i.e. overflows):

if not tid :
    ...
if tid is None :
    ....

Reference:
#2173

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Fix tid overflow issue when tid is zero
@martyy665 martyy665 changed the title Update transaction.py Fix condition to eliminate TID overflow issue Apr 23, 2024
Copy link
Collaborator

@janiversen janiversen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct they are not the same. yours test for none and zero.

@janiversen janiversen merged commit a48aeeb into pymodbus-dev:dev Apr 23, 2024
1 check passed
@janiversen
Copy link
Collaborator

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants