From 0a3fc21e23d9a800439c38ef7c908eb3a431e76d Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Fri, 10 Jan 2020 19:25:38 +0000 Subject: [PATCH] Fix reversed sense of test in rsa1_save_f. It saves key files just fine, but then claims to have failed. (Worse, it would claim to have succeeded if it _did_ fail!) --- sshpubk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sshpubk.c b/sshpubk.c index 73481e68..5b1ff051 100644 --- a/sshpubk.c +++ b/sshpubk.c @@ -423,7 +423,7 @@ bool rsa1_save_f(const Filename *filename, RSAKey *key, const char *passphrase) return false; strbuf *buf = rsa1_save_sb(key, passphrase); - bool toret = fwrite(buf->s, 1, buf->len, fp) != buf->len; + bool toret = fwrite(buf->s, 1, buf->len, fp) == buf->len; if (fclose(fp)) toret = false; strbuf_free(buf);