Skip to content

Commit

Permalink
Fix modulo by zero, resulting in FPE
Browse files Browse the repository at this point in the history
Fix modulo zero error resulting in floating point exception, and then
crash. This was introduced in fd6ce2d.

Closes #265.
  • Loading branch information
b4n committed May 7, 2014
1 parent de57548 commit a6b1433
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/keyfile.c
Expand Up @@ -1203,7 +1203,7 @@ void configuration_open_files(void)
gint target_page = session_notebook_page >= 0 ? session_notebook_page : cur_page;

/* if target page is current page, switch to another page first to really trigger an event */
if (target_page == cur_page)
if (target_page == cur_page && n_pages > 0)
gtk_notebook_set_current_page(GTK_NOTEBOOK(main_widgets.notebook), (cur_page + 1) % n_pages);

main_status.opening_session_files = FALSE;
Expand Down

0 comments on commit a6b1433

Please sign in to comment.