File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2768,8 +2768,11 @@ int CVersionUpdater::_PollDownload()
2768
2768
return RES_OK;
2769
2769
}
2770
2770
if (m_JobInfo.bShowDownloadPercent )
2771
- GetQuestionBox ().SetMessage (
2772
- SString (_ (" %3d %% completed" ), Round (m_JobInfo.uiBytesDownloaded * 100 .f / std::max<float >(1 , m_JobInfo.iFilesize ))));
2771
+ {
2772
+ const bool bIsDownloadedSizeRight = m_JobInfo.uiBytesDownloaded > 0 && m_JobInfo.iFilesize >= m_JobInfo.uiBytesDownloaded ;
2773
+ const float fDownloadedPercent = bIsDownloadedSizeRight ? Round (m_JobInfo.uiBytesDownloaded / m_JobInfo.iFilesize * 100 .f ) : 0 ;
2774
+ GetQuestionBox ().SetMessage (SString (_ (" %3d %% completed" ), fDownloadedPercent ));
2775
+ }
2773
2776
if (m_JobInfo.iIdleTime > 1000 && m_JobInfo.iIdleTimeLeft > 500 )
2774
2777
GetQuestionBox ().AppendMessage (SString (_ (" \n\n Waiting for response - %-3d" ), m_JobInfo.iIdleTimeLeft / 1000 ));
2775
2778
else
You can’t perform that action at this time.
0 commit comments