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

gio: fix UnixSocketAddress constructor with a path #1218

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

pbor
Copy link
Contributor

@pbor pbor commented Nov 2, 2023

as_os_str().len() does not return the number of bytes in the string, but the full allocation size. Just pass -1 and let glib calculate the len.

@pbor
Copy link
Contributor Author

pbor commented Nov 2, 2023

Marked as draft because even with the length fixed by passing -1 to glib, the unit test still fails.
To check what is going on I tried to print std::ffi::CStr::from_ptr(path.to_glib_none().0) for the Path case and it shows garbage

@pbor
Copy link
Contributor Author

pbor commented Nov 2, 2023

(Also I need to drop the gir and gir-files changes, but that is secondary)

as_os_str().len() does not return the number of bytes in the string, but
the full allocation size. Just pass -1 and let glib calculate the len.
@pbor
Copy link
Contributor Author

pbor commented Nov 2, 2023

The problem was that the stash did not live long enough

@pbor pbor marked this pull request as ready for review November 2, 2023 11:40
@bilelmoussaoui bilelmoussaoui added the needs-backport PR needs backporting to the current stable branch label Nov 2, 2023
@sdroege sdroege merged commit d9cc325 into gtk-rs:master Nov 2, 2023
48 checks passed
@sdroege sdroege removed the needs-backport PR needs backporting to the current stable branch label Dec 10, 2023
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.

3 participants