From 09c8d17c9474cf7d426fa742345ad5139e95ee62 Mon Sep 17 00:00:00 2001 From: Gabriele Date: Mon, 2 Feb 2015 13:00:55 +0100 Subject: [PATCH] WebUI: Fix negative offsets when requesting torrent list If the offset is negative, it must be added to the current list size. --- src/webui/btjson.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webui/btjson.cpp b/src/webui/btjson.cpp index 2f5cf515d..8d5677f07 100644 --- a/src/webui/btjson.cpp +++ b/src/webui/btjson.cpp @@ -250,7 +250,7 @@ QByteArray btjson::getTorrents(QString filter, QString label, int size = torrent_list.size(); // normalize offset if (offset < 0) - offset = size - offset; + offset = size + offset; if ((offset >= size) || (offset < 0)) offset = 0; // normalize limit