mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-23 04:54:18 +00:00
WebUI: Fix negative offsets when requesting torrent list
If the offset is negative, it must be added to the current list size.
This commit is contained in:
parent
8eaaa41573
commit
09c8d17c94
@ -250,7 +250,7 @@ QByteArray btjson::getTorrents(QString filter, QString label,
|
|||||||
int size = torrent_list.size();
|
int size = torrent_list.size();
|
||||||
// normalize offset
|
// normalize offset
|
||||||
if (offset < 0)
|
if (offset < 0)
|
||||||
offset = size - offset;
|
offset = size + offset;
|
||||||
if ((offset >= size) || (offset < 0))
|
if ((offset >= size) || (offset < 0))
|
||||||
offset = 0;
|
offset = 0;
|
||||||
// normalize limit
|
// normalize limit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user