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

gtk4: Use correct length for the StrV when passing to C #1298

Merged
merged 1 commit into from Feb 10, 2023

Conversation

sdroege
Copy link
Member

@sdroege sdroege commented Feb 10, 2023

C doesn't want the NUL-terminator to be counted.


CC @pbor Can you check all your commits for the same bug?

Maybe the API should be changed to not return the NULL pointer at the end, but only return a slice of the valid elements (while still keeping the NULL pointer behind the last element). Opinions? Also @jf2048?

C doesn't want the `NUL`-terminator to be counted.

Fixes gtk-rs#1297
@sdroege sdroege force-pushed the add-constraints-from-description-len branch from b2755dd to 6d19e11 Compare February 10, 2023 09:27
@jf2048
Copy link
Member

jf2048 commented Feb 10, 2023

Maybe the API should be changed to not return the NULL pointer at the end, but only return a slice of the valid elements (while still keeping the NULL pointer behind the last element). Opinions?

That would make sense and be consistent with GStr/GString, is there any problem with doing that?

@sdroege
Copy link
Member Author

sdroege commented Feb 10, 2023

No, only that it would change the API and has to wait until the next release

@sdroege sdroege merged commit 6cfb451 into gtk-rs:master Feb 10, 2023
@sdroege sdroege deleted the add-constraints-from-description-len branch February 10, 2023 19:01
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.

[BUG] v0.6.0 segfaults in gtk::ConstraintLayout::add_constraints_from_description
3 participants