mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-29 01:06:27 -05:00
Statistics: Fix average password length
The average password length shown in the Statistics report is now computed based on the total number of passwords. Previously, it was erroneously computed based on the number of unique passwords. Fixes #5134.
This commit is contained in:
parent
14b01784ec
commit
66f5a8736a
@ -58,7 +58,8 @@ namespace
|
||||
// Get average password length
|
||||
int averagePwdLength() const
|
||||
{
|
||||
return m_passwords.empty() ? 0 : pwdTotalLen / m_passwords.size();
|
||||
const auto nPwds = nPwdsUnique + nPwdsReused;
|
||||
return nPwds == 0 ? 0 : std::round(pwdTotalLen / double(nPwds));
|
||||
}
|
||||
|
||||
// Get max number of password reuse (=how many entries
|
||||
|
Loading…
Reference in New Issue
Block a user