(task_http.c) Use 100% as maximum, not minimum

With previous logic, any normal percentage would get MAX'd to 100% 
(max(70, 100) == 100). Correct math to use here is min
This commit is contained in:
Ash Logan 2021-07-18 14:47:25 +10:00
parent e5bbd9488f
commit a35323ace9

View File

@ -133,7 +133,7 @@ static int task_http_iterate_transfer(retro_task_t *task)
task_set_progress(task, (signed)(pos * 100 / tot));
else
/* but invert the logic if it would cause an overflow */
task_set_progress(task, MAX((signed)pos / (tot / 100), 100));
task_set_progress(task, MIN((signed)pos / (tot / 100), 100));
return -1;
}