gui/hdd_menu.cpp: prevent divide by zero

Origin commit data
------------------
Commit: 9b697fb52b
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-09-12 (Fri, 12 Sep 2014)
This commit is contained in:
[CST] Focus
2014-09-12 11:35:58 +04:00
parent 7d5aa057a6
commit 727027345c

View File

@@ -891,6 +891,8 @@ int CHDDMenuHandler::formatDevice(std::string dev)
break;
case 1:
if (in == '\b' && sscanf(buf, "%d/%d\b", &n, &t) == 2) {
if (t == 0)
t = 1;
int percent = 100 * n / t;
progress->showLocalStatus(percent);
progress->showGlobalStatus(20 + percent / 5);