Browse Source

WebUI: Fix negative offsets when requesting torrent list

If the offset is negative, it must be added to the current list size.
adaptive-webui-19844
Gabriele 10 years ago
parent
commit
09c8d17c94
  1. 2
      src/webui/btjson.cpp

2
src/webui/btjson.cpp

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

Loading…
Cancel
Save