X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/0016d70b76e2706064b54c9dd24d45a45646b0de..bf1e6912b12754fd79a48dfe6d77760532598dc3:/sshpubk.c diff --git a/sshpubk.c b/sshpubk.c index 13a182a5..9e89fe97 100644 --- a/sshpubk.c +++ b/sshpubk.c @@ -376,7 +376,8 @@ int saversakey(const Filename *filename, struct RSAKey *key, char *passphrase) fp = f_open(*filename, "wb"); if (fp) { int ret = (fwrite(buf, 1, p - buf, fp) == (size_t) (p - buf)); - ret = ret && (fclose(fp) == 0); + if (fclose(fp)) + ret = 0; return ret; } else return 0;