diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-07-21 14:07:23 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-07-21 14:07:23 +0200 |
commit | b534bfc520282a533fabf72c36f554b035460d6d (patch) | |
tree | a43fcb14235e98944d74289ffc08e8c517d55a00 /libssh/keyfiles.c | |
parent | 41a8fb5810759118d93bee30a254ecf4863437b5 (diff) | |
download | libssh-b534bfc520282a533fabf72c36f554b035460d6d.tar.gz libssh-b534bfc520282a533fabf72c36f554b035460d6d.tar.xz libssh-b534bfc520282a533fabf72c36f554b035460d6d.zip |
Fix ssh_write_knownhost() which always returned -1.
fwrite() return the the number of items written not the size of the
buffer.
Diffstat (limited to 'libssh/keyfiles.c')
-rw-r--r-- | libssh/keyfiles.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index f944e818..ad456cdf 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; } |