projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
catcrypt.c: Don't close output file twice.
[u/mdw/catacomb]
/
catcrypt.c
diff --git
a/catcrypt.c
b/catcrypt.c
index
6e4f245
..
d10739d
100644
(file)
--- a/
catcrypt.c
+++ b/
catcrypt.c
@@
-530,19
+530,18
@@
static int decrypt(int argc, char *argv[])
if (ferror(rfp) || fclose(rfp))
die(EXIT_FAILURE, "error unbuffering output: %s", strerror(errno));
}
if (ferror(rfp) || fclose(rfp))
die(EXIT_FAILURE, "error unbuffering output: %s", strerror(errno));
}
- if (ofp && (fflush(ofp) || ferror(ofp) || fclose(ofp)))
- die(EXIT_FAILURE, "error writing output: %s", strerror(errno));
e->ops->decdone(e);
if (verb && ofp != stdout)
printf("OK decrypted successfully\n");
e->ops->decdone(e);
if (verb && ofp != stdout)
printf("OK decrypted successfully\n");
+ if (ofp && (fflush(ofp) || ferror(ofp) || fclose(ofp)))
+ die(EXIT_FAILURE, "error writing output: %s", strerror(errno));
freeenc(e);
GC_DESTROY(c);
GC_DESTROY(cx);
GM_DESTROY(m);
freekem(km);
if (fp != stdin) fclose(fp);
freeenc(e);
GC_DESTROY(c);
GC_DESTROY(cx);
GM_DESTROY(m);
freekem(km);
if (fp != stdin) fclose(fp);
- if (of) fclose(ofp);
key_close(&kf);
dstr_destroy(&d);
return (0);
key_close(&kf);
dstr_destroy(&d);
return (0);