From 7fc1b3a32c6a870c47d7459b23fd7c7b63014186 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Tue, 7 Mar 2023 05:42:44 -0700 Subject: [PATCH] hac2l: cap percentage calculation when progress-printing (closes #2) --- source/hactool_fs_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/hactool_fs_utils.cpp b/source/hactool_fs_utils.cpp index 13825dd..515c936 100644 --- a/source/hactool_fs_utils.cpp +++ b/source/hactool_fs_utils.cpp @@ -44,7 +44,7 @@ namespace ams::hactool { m_current = new_current; const size_t unit = m_total / Count; - if (const size_t segs = m_current / unit; segs != m_segs) { + if (const size_t segs = std::min(m_current / unit, Count); segs != m_segs) { m_segs = segs; this->Render(); }