From 8310b8cc2bed25a4c0b469c215b53878cf960f1e Mon Sep 17 00:00:00 2001 From: Navid Fayezi Date: Thu, 19 Jun 2025 18:10:18 -0600 Subject: [PATCH] Remove redundant line and change strlen(buffer) to sizeof(buffer) in examples/authentication.c Signed-off-by: Navid Fayezi Reviewed-by: Andreas Schneider Reviewed-by: Jakub Jelen --- examples/authentication.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/authentication.c b/examples/authentication.c index 172d2278..f6a5dbd5 100644 --- a/examples/authentication.c +++ b/examples/authentication.c @@ -66,7 +66,6 @@ int authenticate_kbdint(ssh_session session, const char *password) return SSH_AUTH_ERROR; } - buffer[sizeof(buffer) - 1] = '\0'; if ((p = strchr(buffer, '\n'))) { *p = '\0'; } @@ -75,7 +74,7 @@ int authenticate_kbdint(ssh_session session, const char *password) return SSH_AUTH_ERROR; } - memset(buffer, 0, strlen(buffer)); + memset(buffer, 0, sizeof(buffer)); } else { if (password && strstr(prompt, "Password:")) { answer = password;