diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 10b3d83f6..cdd59b758 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -1952,9 +1952,10 @@ int main(int argc, char* argv[]) // handle scrolling down when moving the cursor // below the fold - int start_offset = 0; - if (active_torrent >= max_lines - lines_printed) + static int start_offset = 0; + if (active_torrent >= max_lines - lines_printed - start_offset) start_offset = active_torrent - max_lines + lines_printed + 1; + if (active_torrent < start_offset) start_offset = active_torrent; for (std::vector::iterator i = filtered_handles.begin(); i != filtered_handles.end(); ++torrent_index)