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

Fix passing non null terminated strings for null terminated params #1924

Merged
merged 2 commits into from
May 25, 2024

Conversation

smilediver
Copy link
Contributor

Fixes some cases where std::string_view is passed to [NSString stringWithUTF8String:]. stringWithUTF8String expects a zero terminated string.

@halx99
Copy link
Collaborator

halx99 commented May 24, 2024

caller should ensure string_view is null-terminated

@smilediver
Copy link
Contributor Author

caller should ensure string_view is null-terminated

No, that's a bad idea. The whole purpose of std::string_view is to represent a non null-terminated string. So if API takes std::string_view, then it must treat it as not null-terminated.

@halx99 halx99 added this to the 2.1.3 milestone May 25, 2024
@halx99 halx99 added the enhancement New feature or request label May 25, 2024
@halx99 halx99 merged commit 7ca10e7 into axmolengine:dev May 25, 2024
15 checks passed
@smilediver smilediver deleted the fix_strings branch May 29, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants