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

base64::encode: Adjusted buffer size algorithm #4934

Merged
merged 4 commits into from
Jul 19, 2018
Merged

base64::encode: Adjusted buffer size algorithm #4934

merged 4 commits into from
Jul 19, 2018

Conversation

LaborEtArs
Copy link
Contributor

The code
size_t size = ((length * 1.6f) + 1);
gives wrong values for small input lengths.
Use cencode.h defined macros to calculate the needed buffer size instead.

Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

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

Seems good to me. I can't believe we have a floating point multiply in the code just to (incorrectly) get the appropriate length!

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.

3 participants