Skip to content

Commit

Permalink
gtk4: Use correct length for the StrV when passing to C
Browse files Browse the repository at this point in the history
C doesn't want the `NUL`-terminator to be counted.

Fixes #1297
  • Loading branch information
sdroege committed Feb 10, 2023
1 parent 5db45ce commit 6d19e11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gtk4/src/constraint_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl ConstraintLayout {
let out = ffi::gtk_constraint_layout_add_constraints_from_descriptionv(
self.to_glib_none().0,
lines.as_ptr() as *const _,
lines.len() as _,
lines.len().saturating_sub(1) as _,
hspacing,
vspacing,
hash_table,
Expand Down

0 comments on commit 6d19e11

Please sign in to comment.