forked from AuroraMiddleware/gtk
sizerequest: Avoid a corner case
gcc 11 warns that the code isn't safe when n_requested_sizes is 0. Add a precondition check to make it clear that that never happens.
This commit is contained in:
parent
ea185cbdda
commit
8b82993dde
@ -698,6 +698,7 @@ gtk_distribute_natural_allocation (int extra_space,
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (extra_space >= 0, 0);
|
||||
g_return_val_if_fail (n_requested_sizes > 0, 0);
|
||||
|
||||
spreading = g_newa (guint, n_requested_sizes);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user