From 393db176f0a97bce7acbd2ae91d36ea158f03b1d Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Mon, 13 Dec 2021 15:48:32 +0100 Subject: [PATCH] Added progress bar constraint: cur <= total --- src/utils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.cpp b/src/utils.cpp index ecd268c..42a1e71 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -38,6 +38,7 @@ void term::progress(int prefixlen, u8"\u258F", u8"\u258E", u8"\u258D", u8"\u258C", u8"\u258B", u8"\u258A", u8"\u2589", u8"\u2588" }; + if (cur > total) cur = total; int perclen = 5; int barwidth = cols() - perclen - prefixlen - 1; int maxsteps = barwidth * 8;