From b534bfc520282a533fabf72c36f554b035460d6d Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 21 Jul 2009 14:07:23 +0200 Subject: Fix ssh_write_knownhost() which always returned -1. fwrite() return the the number of items written not the size of the buffer. --- libssh/keyfiles.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libssh/keyfiles.c') diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index f944e81..ad456cd 100644 --- a/libssh/keyfiles.c +++ b/libssh/keyfiles.c @@ -1576,7 +1576,7 @@ int ssh_write_knownhost(SSH_SESSION *session) { } len = strlen(buffer); - if (fwrite(buffer, len, 1, file) != len || ferror(file)) { + if (fwrite(buffer, len, 1, file) != 1 || ferror(file)) { fclose(file); return -1; } -- cgit