From 1287dabd0b23326be491125698dd982e4ae28887 Mon Sep 17 00:00:00 2001 From: x2018 Date: Tue, 26 Oct 2021 15:16:18 +0800 Subject: fix some code with obvious wrong coding style Reviewed-by: Tomas Mraz Reviewed-by: Richard Levitte Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/16918) --- demos/digest/BIO_f_md.c | 16 ++++++++-------- demos/digest/EVP_MD_stdin.c | 2 +- demos/kdf/pbkdf2.c | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'demos') diff --git a/demos/digest/BIO_f_md.c b/demos/digest/BIO_f_md.c index 2ecc53e137..0a1f319f11 100644 --- a/demos/digest/BIO_f_md.c +++ b/demos/digest/BIO_f_md.c @@ -47,7 +47,7 @@ int main(int argc, char * argv[]) char *digest_value=NULL; int j; - input = BIO_new_fd( fileno(stdin), 1 ); + input = BIO_new_fd(fileno(stdin), 1); if (input == NULL) { fprintf(stderr, "BIO_new_fd() for stdin returned NULL\n"); goto cleanup; @@ -63,7 +63,7 @@ int main(int argc, char * argv[]) * The algorithm name is case insensitive. * See providers(7) for details about algorithm fetching */ - md = EVP_MD_fetch( library_context, "SHA3-512", NULL ); + md = EVP_MD_fetch(library_context, "SHA3-512", NULL); if (md == NULL) { fprintf(stderr, "EVP_MD_fetch did not find SHA3-512.\n"); goto cleanup; @@ -81,7 +81,7 @@ int main(int argc, char * argv[]) goto cleanup; } /* set our bio_digest BIO to digest data */ - if (BIO_set_md(bio_digest,md) != 1) { + if (BIO_set_md(bio_digest, md) != 1) { fprintf(stderr, "BIO_set_md failed.\n"); goto cleanup; } @@ -89,9 +89,9 @@ int main(int argc, char * argv[]) * We will use BIO chaining so that as we read, the digest gets updated * See the man page for BIO_push */ - BIO *reading = BIO_push( bio_digest, input ); - - while( BIO_read(reading, buffer, sizeof(buffer)) > 0 ) + BIO *reading = BIO_push(bio_digest, input); + + while (BIO_read(reading, buffer, sizeof(buffer)) > 0) ; /*- @@ -102,12 +102,12 @@ int main(int argc, char * argv[]) fprintf(stderr, "BIO_gets(bio_digest) failed\n"); goto cleanup; } - for (j=0; j