Make the handling of output and input formats consistent
[openssl.git] / apps / sess_id.c
index 681654335ab1dde43dcec996965f4a272c35563b..e743791d23f5eb8eb438707031648bfbe1adc75a 100644 (file)
@@ -160,10 +160,7 @@ int sess_id_main(int argc, char **argv)
     }
 
     if (!noout || text) {
-        const char* modeflag = "w";
-        if (outformat == FORMAT_ASN1 || outformat == FORMAT_NSS)
-            modeflag = "wb";
-        out = bio_open_default(outfile, modeflag);
+        out = bio_open_default(outfile, WB(outformat));
         if (out == NULL)
             goto end;
     }