Merge pull request #12671 from QuarkTheAwesome/http-progress-fix

(task_http.c) Fix progress indication for large files on 32-bit systems
This commit is contained in:
Autechre 2021-07-18 22:16:18 +02:00 committed by GitHub
commit 21cf6b89a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}