diff options
Diffstat (limited to 'cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp')
-rwxr-xr-x | cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp b/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp index 83b381ca661..f3b02d65ca4 100755 --- a/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp +++ b/cpp/demo/IcePatch2/MFC/PatchClientDlg.cpp @@ -203,7 +203,11 @@ CPatchDlg::patchProgress(Ice::Long, Ice::Long, Ice::Long totalProgress, Ice::Lon _speed->SetWindowText(speed); } - int pcnt = static_cast<int>(totalProgress * 100 / totalSize); + int pcnt = 100; + if(totalSize > 0) + { + pcnt = static_cast<int>(totalProgress * 100 / totalSize); + } CString percent; percent.Format("%d%%", pcnt); _percent->SetWindowText(percent); |