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

NANDImporter: Construct strings correctly #6148

Merged
merged 1 commit into from
Oct 29, 2017

Conversation

leoetlino
Copy link
Member

Use std::string(cstring, strnlen(cstring, max_length)) instead of trying to remove extra null characters manually, which is a bit ugly and error prone.

And indeed, the original code contained a bug which would cause extra NULLs to not be removed at all if the string did not end with a NULL -- causing issues down the road when constructing paths for sub-entries.

Use std::string(cstring, strnlen(cstring, max_length)) instead of
trying to remove extra null characters manually, which is a bit
ugly and error prone.

And indeed, the original code contained a bug which would cause
extra NULLs to not be removed at all if the string did not
end with a NULL -- causing issues down the road when constructing
paths for sub-entries.
@leoetlino leoetlino merged commit 91dac03 into dolphin-emu:master Oct 29, 2017
@leoetlino leoetlino deleted the null-bug branch October 29, 2017 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants