From: simon Date: Mon, 22 Nov 2004 11:02:44 +0000 (+0000) Subject: Trivial bug fix pointed out by Paul Fox: potentially missing fclose(). X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/commitdiff_plain/6402ecf98bf9e870f25e06e7ad9b6e08d3021dd4?hp=c19a50ed930f391506dc660a01090a51d659acd3 Trivial bug fix pointed out by Paul Fox: potentially missing fclose(). git-svn-id: svn://svn.tartarus.org/sgt/putty@4877 cda61777-01e9-0310-a592-d414129be87e --- 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;