From a35323ace9971042c81f084d37aa7f21d0886431 Mon Sep 17 00:00:00 2001 From: Ash Logan Date: Sun, 18 Jul 2021 14:47:25 +1000 Subject: [PATCH] (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 --- tasks/task_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/task_http.c b/tasks/task_http.c index 28ba001d26..eac88020ed 100644 --- a/tasks/task_http.c +++ b/tasks/task_http.c @@ -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; }