mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
Remove redundant line and change strlen(buffer) to sizeof(buffer) in examples/authentication.c
Signed-off-by: Navid Fayezi <navidfayezi.98@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Jakub Jelen
parent
b0063b52d8
commit
8310b8cc2b
@@ -66,7 +66,6 @@ int authenticate_kbdint(ssh_session session, const char *password)
|
|||||||
return SSH_AUTH_ERROR;
|
return SSH_AUTH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer[sizeof(buffer) - 1] = '\0';
|
|
||||||
if ((p = strchr(buffer, '\n'))) {
|
if ((p = strchr(buffer, '\n'))) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
}
|
}
|
||||||
@@ -75,7 +74,7 @@ int authenticate_kbdint(ssh_session session, const char *password)
|
|||||||
return SSH_AUTH_ERROR;
|
return SSH_AUTH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(buffer, 0, strlen(buffer));
|
memset(buffer, 0, sizeof(buffer));
|
||||||
} else {
|
} else {
|
||||||
if (password && strstr(prompt, "Password:")) {
|
if (password && strstr(prompt, "Password:")) {
|
||||||
answer = password;
|
answer = password;
|
||||||
|
|||||||
Reference in New Issue
Block a user