summaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorx2018 <xkernel.wang@foxmail.com>2021-10-26 15:16:18 +0800
committerPauli <pauli@openssl.org>2021-10-28 13:10:46 +1000
commit1287dabd0b23326be491125698dd982e4ae28887 (patch)
tree3d6a62803bdd3d8ca9378eda3e7316a9c995c001 /crypto/rand
parent01451721afebabd0b7bdcd4cb3a183c9b590d266 (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 'crypto/rand')
-rw-r--r--crypto/rand/rand_egd.c6
-rw-r--r--crypto/rand/randfile.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c
index dc1833169c..bb862f61ad 100644
--- a/crypto/rand/rand_egd.c
+++ b/crypto/rand/rand_egd.c
@@ -85,14 +85,14 @@ int hpns_socket(int family,
socket_transport_name_get(AF_UNIX, current_transport, 20);
- if (strcmp(current_transport,transport) == 0)
+ if (strcmp(current_transport, transport) == 0)
return socket(family, type, protocol);
/* set the requested socket transport */
if (socket_transport_name_set(AF_UNIX, transport))
return -1;
- socket_rc = socket(family,type,protocol);
+ socket_rc = socket(family, type, protocol);
/* set mode back to what it was */
if (socket_transport_name_set(AF_UNIX, current_transport))
@@ -135,7 +135,7 @@ int RAND_query_egd_bytes(const char *path, unsigned char *buf, int bytes)
setbuf(fp, NULL);
/* Try to connect */
- for ( ; ; ) {
+ for (;;) {
if (connect(fd, (struct sockaddr *)&addr, i) == 0)
break;
# ifdef EISCONN
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 82f4163738..31edd4f560 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -144,14 +144,14 @@ int RAND_load_file(const char *file, long bytes)
# pragma environment restore
#endif
- for ( ; ; ) {
+ for (;;) {
if (bytes > 0)
n = (bytes <= RAND_LOAD_BUF_SIZE) ? (int)bytes : RAND_BUF_SIZE;
else
n = RAND_LOAD_BUF_SIZE;
i = fread(buf, 1, n, in);
#ifdef EINTR
- if (ferror(in) && errno == EINTR){
+ if (ferror(in) && errno == EINTR) {
clearerr(in);
if (i == 0)
continue;