From 9f5430e4497489a3b27bbdb723fbf4f5d37feb57 Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Mon, 25 Apr 2011 16:54:21 +0200 Subject: [PATCH] Handle 0 pages-per-row --- zathura.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zathura.c b/zathura.c index c323f91..5295987 100644 --- a/zathura.c +++ b/zathura.c @@ -335,6 +335,11 @@ error_out: void page_view_set_mode(zathura_t* zathura, unsigned int pages_per_row) { + /* show at least one page */ + if (pages_per_row == 0) { + pages_per_row = 1; + } + gtk_table_resize(GTK_TABLE(zathura->ui.page_view), zathura->document->number_of_pages / pages_per_row + 1, pages_per_row); for (unsigned int i = 0; i < zathura->document->number_of_pages; i++) {