Skip to content

Commit

Permalink
General updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dr8co committed Sep 18, 2023
1 parent d4eb8f5 commit 6df7c2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/passwordManager/passwordManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<passwordRecords> &passwords) {
privacy::string site{getResponseStr("Enter the name of the site/app: ")};
// The site name must be non-empty
Expand Down Expand Up @@ -604,7 +604,7 @@ inline void analyzePasswords(privacy::vector<passwordRecords> &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);

Expand Down
6 changes: 3 additions & 3 deletions src/passwordManager/passwords.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<char, crypto_pwhash_STRBYTES> 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()};
}

/**
Expand Down

0 comments on commit 6df7c2b

Please sign in to comment.