]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Trivial bug fix pointed out by Paul Fox: potentially missing fclose().
authorSimon Tatham <anakin@pobox.com>
Mon, 22 Nov 2004 11:02:44 +0000 (11:02 +0000)
committerSimon Tatham <anakin@pobox.com>
Mon, 22 Nov 2004 11:02:44 +0000 (11:02 +0000)
[originally from svn r4877]

sshpubk.c

index 13a182a5cae689853145d59cf3a64f926413e965..9e89fe97cc5805430094060e127621c86743555e 100644 (file)
--- 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;