Skip to content

Commit 74513ab

Browse files
author
Matteo Biggio
committed
strv: when calling g_strv ffi method, use our as_ptr implementation
Calling `self.ptr.as_ptr` does not properly convert a 0-sized strv to a NULL-terminated array
1 parent 37a40ed commit 74513ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

glib/src/collections/strv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ impl StrV {
860860
separator.run_with_gstr(|separator| unsafe {
861861
from_glib_full(ffi::g_strjoinv(
862862
separator.to_glib_none().0,
863-
self.ptr.as_ptr(),
863+
self.as_ptr() as *mut _,
864864
))
865865
})
866866
}
@@ -872,7 +872,7 @@ impl StrV {
872872
pub fn contains(&self, s: impl IntoGStr) -> bool {
873873
s.run_with_gstr(|s| unsafe {
874874
from_glib(ffi::g_strv_contains(
875-
self.ptr.as_ptr() as *const _,
875+
self.as_ptr() as *const _,
876876
s.to_glib_none().0,
877877
))
878878
})

0 commit comments

Comments
 (0)