mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:26:01 +01:00
fix page range check
In those cases, page is in the range [1...N], both ends included. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
0e733af2a5
commit
2778868599
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue