X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fdhparam.c;fp=apps%2Fdhparam.c;h=fc3a51ead46c031f3033126c10ce8e20b4fd4dd4;hp=6cd059fd162b7840e500414189cfd9a8cc827b71;hb=2234212c3dde887e0b7fa08277d035cd132e2cce;hpb=71d8c138cf0a72663cd401d753564eecd8c23289 diff --git a/apps/dhparam.c b/apps/dhparam.c index 6cd059fd16..fc3a51ead4 100644 --- a/apps/dhparam.c +++ b/apps/dhparam.c @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -138,7 +138,7 @@ int dhparam_main(int argc, char **argv) argc = opt_num_rest(); argv = opt_rest(); - if (argv[0] && (!opt_int(argv[0], &num) || num <= 0)) + if (argv[0] != NULL && (!opt_int(argv[0], &num) || num <= 0)) goto end; if (g && !num) @@ -354,10 +354,11 @@ int dhparam_main(int argc, char **argv) i = i2d_DHxparams_bio(out, dh); else i = i2d_DHparams_bio(out, dh); - } else if (q != NULL) + } else if (q != NULL) { i = PEM_write_bio_DHxparams(out, dh); - else + } else { i = PEM_write_bio_DHparams(out, dh); + } if (!i) { BIO_printf(bio_err, "unable to write DH parameters\n"); ERR_print_errors(bio_err);