-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fixes warnings for sign-compare #8
base: master
Are you sure you want to change the base?
Conversation
src/batchproof.cpp
Outdated
@@ -56,7 +56,7 @@ bool BatchProof::Unserialize(const std::vector<uint8_t>& bytes) | |||
return false; | |||
} | |||
|
|||
int data_offset = 0; | |||
uint8_t data_offset = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure this would overflow as an uint8_t
while reading the hashes here:
Line 86 in d36b624
data_offset += 32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to uint32_t.
Fixes the code so that the sign comparison warnings go away.
d36b624
to
6da610e
Compare
@@ -162,7 +162,7 @@ bool UndoBatch::Unserialize(const std::vector<uint8_t>& bytes) | |||
return false; | |||
} | |||
|
|||
int data_offset = 0; | |||
uint8_t data_offset = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the code so that the sign comparison warnings go away.