Make the handling of output and input formats consistent
[openssl.git] / apps / smime.c
index 45898de4c14ddc39571c8f552c26d5ea340136e8..d597ebf53479669b200004ddc3f042cfb837b5c0 100644 (file)
@@ -427,16 +427,14 @@ int smime_main(int argc, char **argv)
         flags &= ~PKCS7_DETACHED;
 
     if (operation & SMIME_OP) {
-        if (outformat == FORMAT_ASN1)
-            outmode = "wb";
+        outmode = WB(outformat);
     } else {
         if (flags & PKCS7_BINARY)
             outmode = "wb";
     }
 
     if (operation & SMIME_IP) {
-        if (informat == FORMAT_ASN1)
-            inmode = "rb";
+        inmode = RB(informat);
     } else {
         if (flags & PKCS7_BINARY)
             inmode = "rb";