diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-07-21 14:07:23 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-07-23 09:07:26 +0200 |
commit | b07ec7a3d125bd17f7769e471fe82e9a7aba22bf (patch) | |
tree | 642f973b8e5aed6b80d23e3c64fcf94cb25d148b /libssh | |
parent | 09d4029ac1b7ff087380ff41e93515a12ad7ab1f (diff) | |
download | libssh-b07ec7a3d125bd17f7769e471fe82e9a7aba22bf.tar.gz libssh-b07ec7a3d125bd17f7769e471fe82e9a7aba22bf.tar.xz libssh-b07ec7a3d125bd17f7769e471fe82e9a7aba22bf.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')
-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; } |