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 possible overflow in offset calculation #19

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

mertzt89
Copy link
Contributor

@mertzt89 mertzt89 commented Nov 8, 2022

I'm running this on embedded hardware and if the current system time is 0, get_time() results in an overflow. This change adjusts the math to use an wrapping add to avoid the overflow.

@vpetrigo
Copy link
Owner

vpetrigo commented Nov 9, 2022

Hello @mertzt89,

Nice catch! Thank you for the contribution, really appreciate that. 😄 I'll made some housekeeping stuff after merge and publish a new crate as soon as possible.

@vpetrigo vpetrigo self-assigned this Nov 9, 2022
@vpetrigo vpetrigo merged commit 58fa630 into vpetrigo:master Nov 9, 2022
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