Skip to content

Commit

Permalink
Initialise all column widths in set_dimensions_pass_two()
Browse files Browse the repository at this point in the history
It shouldn't be possible for the number of columns to be different between
the header cursor and the other cursors but the return value from
g_table_index() is checked just in case this happens.

If this did happen, the width would be set using an uninitialised value
so initialise them all to 0.
  • Loading branch information
nomis committed Jun 24, 2023
1 parent 1e1e922 commit 2628ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gnucash/register/register-gnome/gnucash-style.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ set_dimensions_pass_two (GnucashSheet *sheet, int default_width)

width = 0;
num_cols = cursor->num_cols;
widths = g_new (int, num_cols);
widths = g_new0 (int, num_cols);

/* find header widths */
for (col = 0; col < num_cols; col++)
Expand Down

0 comments on commit 2628ad0

Please sign in to comment.