From e98f3e30335e3061a2a2d65f297e8a26d77c480c Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sat, 11 Jul 2026 00:15:36 +0200 Subject: kleinere Fehlerkorrekturen im Beispiel --- src/bcrypt-test.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/bcrypt-test.c') diff --git a/src/bcrypt-test.c b/src/bcrypt-test.c index 57cf390..b3f6dbb 100644 --- a/src/bcrypt-test.c +++ b/src/bcrypt-test.c @@ -20,8 +20,8 @@ valid_char(int chr) /** * Create a new user/password * - * \param[in] username - * \param[in] password + * \param[in] username User name. + * \param[in] password Plain-text password. * * \return true on success (user was created) or false on error */ @@ -43,6 +43,8 @@ create_user(const char *username, const char *password) // NOLINT char hash[_PASSWORD_LEN + 1] = { 0 }; if ( bcrypt_newhash(password, SECURITY_LEVEL, hash, _PASSWORD_LEN) != 0 ) { + (void) fclose(database); + return false; } @@ -53,10 +55,10 @@ create_user(const char *username, const char *password) // NOLINT } /** - * Check is a valid username/password exists in the user-database + * Check whether a valid username/password exists in the user-database * - * username A username - * password A strong password + * \param[in] username User name. + * \param[in] password Plain-text password. * * @return true, if the user was successfully authenticated, otherwise false */ @@ -98,9 +100,9 @@ check_user(const char *const username, const char *const password) // NOLINT /** * Check if a valid username already exists in the user-database * - * \param[in] username to be checked + * \param[in] username User name. * - * \return true, if the user was successfully authenticated, otherwise false + * \return true, if the user exists, otherwise false */ bool check_user_if_exists(const char *username) -- cgit v1.3