Skip to content

Commit

Permalink
Merge pull request #14997 from notspiff/fix_div_zero
Browse files Browse the repository at this point in the history
fixed: division by zero in addon installation
  • Loading branch information
MartijnKaijser committed Dec 5, 2018
2 parents 1de0d40 + ba9551b commit 17ad48f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xbmc/addons/AddonInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ bool CAddonInstallJob::Install(const std::string &installFrom, const RepositoryP
SetText(g_localizeStrings.Get(24079));
auto deps = m_addon->GetDependencies();

unsigned int totalSteps = static_cast<unsigned int>(deps.size());
unsigned int totalSteps = static_cast<unsigned int>(deps.size()) + 1;
if (ShouldCancel(0, totalSteps))
return false;

Expand Down Expand Up @@ -786,7 +786,7 @@ bool CAddonInstallJob::Install(const std::string &installFrom, const RepositoryP
}

SetText(g_localizeStrings.Get(24086));
SetProgress(0);
SetProgress(static_cast<unsigned int>(100.0 * (totalSteps - 1.0) / totalSteps));

CFilesystemInstaller fsInstaller;
if (!fsInstaller.InstallToFilesystem(installFrom, m_addon->ID()))
Expand Down

0 comments on commit 17ad48f

Please sign in to comment.