diff --git a/src/main.cpp b/src/main.cpp index c3a50f6..d193945 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -104,7 +104,7 @@ int main(int argc, char **argv) { }; // Display information about the program - std::cout << "Privacy Shield 1.0.0\n" + std::cout << "\nPrivacy Shield 1.0.0\n" "Copyright (C) 2023 Ian Duncan.\n" "This program comes with ABSOLUTELY NO WARRANTY.\n" "This is a free software; you are free to change and redistribute it\n" diff --git a/src/passwordManager/passwordManager.cpp b/src/passwordManager/passwordManager.cpp index dffdd9f..7768134 100644 --- a/src/passwordManager/passwordManager.cpp +++ b/src/passwordManager/passwordManager.cpp @@ -73,7 +73,7 @@ inline constexpr void printPasswordDetails(const auto &pw) noexcept { } -/// @brief Add new password records. +/// @brief Adds a new password to the saved records. inline void addPassword(privacy::vector &passwords) { privacy::string site{getResponseStr("Enter the name of the site/app: ")}; // The site name must be non-empty @@ -604,7 +604,7 @@ inline void analyzePasswords(privacy::vector &passwords) { printColor("------------------------------------------------------", 'r', true); } printColor(std::format("Please change the weak passwords above. " - "\nYou can use the 'generate' command to generate strong passwords.\n"), 'r', + "\nYou can use the 'generate password' option to generate strong passwords.\n"), 'r', true); } else printColor("No weak passwords found. Keep it up!\n", 'g', true); diff --git a/src/passwordManager/passwords.cpp b/src/passwordManager/passwords.cpp index 9e6f352..860ddbd 100644 --- a/src/passwordManager/passwords.cpp +++ b/src/passwordManager/passwords.cpp @@ -111,15 +111,15 @@ privacy::string generatePassword(int length) { */ privacy::string hashPassword(const privacy::string &password, const std::size_t &opsLimit, const std::size_t &memLimit) { - char hashedPassword[crypto_pwhash_STRBYTES]; + std::array hashedPassword{}; if (crypto_pwhash_str - (hashedPassword, password.c_str(), password.size(), + (hashedPassword.data(), password.c_str(), password.size(), opsLimit, memLimit) != 0) { throw std::runtime_error("Out of memory for password hashing."); } - return privacy::string{hashedPassword}; + return privacy::string{hashedPassword.data()}; } /**