From 5b33660ea7032ec26c4b13ed48b1f8dfc78f1cad Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 12 Sep 2014 11:35:58 +0400 Subject: [PATCH] gui/hdd_menu.cpp: prevent divide by zero Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b697fb52b927cf76451527aaf61f326c7728c3f Author: [CST] Focus Date: 2014-09-12 (Fri, 12 Sep 2014) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/hdd_menu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index dadb6e0d7..27a1e481a 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -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);