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

corrected string lengths in example code #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

palto42
Copy link

@palto42 palto42 commented May 6, 2018

The encode and decode length must not include the terminating \0 of the string and the length of the output char array must be 1 larger for the \0 added at the end.
The first point caused incorrect encoding and the second caused an overwrite of the first char of the input string.
I validated the encoding of "Hello world" on Ubuntu CLI using echo -n 'Hello world' | base64

@sebastienvermeille
Copy link

sebastienvermeille commented May 9, 2024

I had the same issue with a special char appended when I decoded message encoded with this library.

Using the changes of this PR it works like a charm thank you @palto42

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.

2 participants