aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libssh/keyfiles.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index ad456cdf..bac0ea2f 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -1074,6 +1074,7 @@ static char **ssh_get_knownhost_line(SSH_SESSION *session, FILE **file,
while (fgets(buffer, sizeof(buffer), *file)) {
ptr = strchr(buffer, '\n');
if (ptr) {
+ *ptr = '\0';
}
ptr = strchr(buffer,'\r');