Browse Source

Merge pull request #2487 from pmzqla/webui-negativeoffset

WebUI: Fix negative offsets when requesting torrent list
adaptive-webui-19844
sledgehammer999 10 years ago
parent
commit
3b677053c7
  1. 2
      src/webui/btjson.cpp

2
src/webui/btjson.cpp

@ -256,7 +256,7 @@ QByteArray btjson::getTorrents(QString filter, QString label, @@ -256,7 +256,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

Loading…
Cancel
Save