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

Avoid int8_t underflow on filament runout #13895

Merged
merged 1 commit into from
May 7, 2019

Conversation

tpruvot
Copy link
Contributor

@tpruvot tpruvot commented May 3, 2019

if the counter reach -127, next could be positive

if the counter reach -127, next could be positive
@thinkyhead
Copy link
Member

This is putting a condom on a condom. We already know the value is not going to overflow because of how it is used. The coder who wrote this class is just being pedantic.

@tpruvot
Copy link
Contributor Author

tpruvot commented May 6, 2019

#13921 may be related

@thinkyhead thinkyhead merged commit 24e956d into MarlinFirmware:bugfix-2.0.x May 7, 2019
@thinkyhead thinkyhead changed the title runout: avoid int8_t negative overflow Avoid int8_t underflow on filament runout May 7, 2019
@tpruvot tpruvot deleted the runout branch May 7, 2019 20:08
ozgunawesome pushed a commit to ozgunawesome/Marlin that referenced this pull request May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants