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

cUUID: Fix FromHexDigit for digits >= 'a' #3975

Merged
merged 1 commit into from
Aug 29, 2017

Conversation

peterbell10
Copy link
Member

Fixes #3974.

I should really write some tests for cUUID.

src/UUID.cpp Outdated
@@ -68,11 +68,11 @@ static Byte FromHexDigit(char a_Hex)
}
if (('a' <= a_Hex) && (a_Hex <= 'f'))
{
return static_cast<Byte>(a_Hex - 'a');
return static_cast<Byte>(a_Hex - ('a' - 10));
Copy link
Member

@madmaxoft madmaxoft Aug 29, 2017

Choose a reason for hiding this comment

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

I think 10 + a_Hex - 'a' would have been more understandable. Perhaps even with parenthesis: 10 + (a_Hex - 'a')

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@Seadragon91
Copy link
Contributor

Seadragon91 commented Aug 29, 2017

Thanks works fine.

@Seadragon91 Seadragon91 merged commit fa5bf7d into cuberite:master Aug 29, 2017
@peterbell10 peterbell10 deleted the rank_bug branch September 12, 2017 17:52
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

3 participants