Commit 27788685 authored by Abdo Roig-Maranges's avatar Abdo Roig-Maranges Committed by Sebastian Ramacher

fix page range check

In those cases, page is in the range [1...N], both ends included.
Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 0e733af2
......@@ -249,7 +249,7 @@ handle_method_call(GDBusConnection* UNUSED(connection),
g_variant_get(parameters, "(i)", &page);
bool ret = true;
if (page < 1 || (unsigned int)page >= number_of_pages) {
if (page < 1 || (unsigned int)page > number_of_pages) {
ret = false;
} else {
page_set(priv->zathura, page - 1);
......@@ -264,7 +264,7 @@ handle_method_call(GDBusConnection* UNUSED(connection),
g_variant_get(parameters, "(ia(dddd)a(idddd))", &page, &iter,
&secondary_iter);
if (page < 1 || (unsigned int)page >= number_of_pages) {
if (page < 1 || (unsigned int)page > number_of_pages) {
GVariant* result = g_variant_new("(b)", false);
g_variant_iter_free(iter);
g_variant_iter_free(secondary_iter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment