X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/blobdiff_plain/d31eb5ca590699699b99dcb434c4f058bea4c90a..6a024d24d97cb5d42c0091571735475b849f59f4:/progs/catsign.c diff --git a/progs/catsign.c b/progs/catsign.c index accd592f..3cce9c93 100644 --- a/progs/catsign.c +++ b/progs/catsign.c @@ -749,14 +749,14 @@ static int verify(int argc, char *argv[]) } else if (!of || strcmp(of, "-") == 0) { v.f |= F_BUFFER; ofp = stdout; - } - if (of && !(v.f & F_BUFFER)) { + } else if (of && !(v.f & F_BUFFER)) { if ((ofp = fopen(of, (v.f & F_BINARY) ? "wb" : "w")) == 0) { die(EXIT_FAILURE, "couldn't open file `%s' for output: %s", of, strerror(errno)); } rfp = ofp; - } else if ((rfp = tmpfile()) == 0) + } + if ((v.f & F_BUFFER) && (rfp = tmpfile()) == 0) die(EXIT_FAILURE, "couldn't create temporary file: %s", strerror(errno)); /* --- Read the message and verify the signature --- */