diff options
author | x2018 <xkernel.wang@foxmail.com> | 2021-10-26 15:16:18 +0800 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-10-28 13:10:46 +1000 |
commit | 1287dabd0b23326be491125698dd982e4ae28887 (patch) | |
tree | 3d6a62803bdd3d8ca9378eda3e7316a9c995c001 /demos | |
parent | 01451721afebabd0b7bdcd4cb3a183c9b590d266 (diff) |
fix some code with obvious wrong coding style
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16918)
Diffstat (limited to 'demos')
-rw-r--r-- | demos/digest/BIO_f_md.c | 16 | ||||
-rw-r--r-- | demos/digest/EVP_MD_stdin.c | 2 | ||||
-rw-r--r-- | demos/kdf/pbkdf2.c | 2 |
3 files changed, 10 insertions, 10 deletions
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<digest_size; j++) { + for (j = 0; j < digest_size; j++) { fprintf(stdout, "%02x", (unsigned char)digest_value[j]); } fprintf(stdout, "\n"); result = 0; - + cleanup: if (result != 0) ERR_print_errors_fp(stderr); diff --git a/demos/digest/EVP_MD_stdin.c b/demos/digest/EVP_MD_stdin.c index 71a3d325a3..43a820f945 100644 --- a/demos/digest/EVP_MD_stdin.c +++ b/demos/digest/EVP_MD_stdin.c @@ -124,7 +124,7 @@ cleanup: int main(void) { int result = 1; - BIO *input = BIO_new_fd( fileno(stdin), 1 ); + BIO *input = BIO_new_fd(fileno(stdin), 1); if (input != NULL) { result = demonstrate_digest(input); diff --git a/demos/kdf/pbkdf2.c b/demos/kdf/pbkdf2.c index 3e0adaee79..ae0a63bf60 100644 --- a/demos/kdf/pbkdf2.c +++ b/demos/kdf/pbkdf2.c @@ -35,7 +35,7 @@ static unsigned char password[] = { static unsigned char pbkdf2_salt[] = { 'N', 'a', 'C', 'l' }; - + /* * The iteration parameter can be variable or hard coded. The disadvantage with * hard coding them is that they cannot easily be adjusted for future |