diff options
Diffstat (limited to 'apps/cms.c')
-rw-r--r-- | apps/cms.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/apps/cms.c b/apps/cms.c index 5032866847..aea969a7e4 100644 --- a/apps/cms.c +++ b/apps/cms.c @@ -840,17 +840,9 @@ int cms_main(int argc, char **argv) goto end; } - if (infile) - { - if (!(in = BIO_new_file(infile, inmode))) - { - BIO_printf (bio_err, - "Can't open input file %s\n", infile); - goto end; - } - } - else - in = BIO_new_fp(stdin, BIO_NOCLOSE); + in = bio_open_default(infile, inmode); + if (in == NULL) + goto end; if (operation & SMIME_IP) { @@ -925,19 +917,9 @@ int cms_main(int argc, char **argv) } } - if (outfile) - { - if (!(out = BIO_new_file(outfile, outmode))) - { - BIO_printf (bio_err, - "Can't open output file %s\n", outfile); - goto end; - } - } - else - { - out = BIO_dup_chain(bio_out); - } + out = bio_open_default(outfile, outmode); + if (out == NULL) + goto end; if ((operation == SMIME_VERIFY) || (operation == SMIME_VERIFY_RECEIPT)) { |