Skip to content

Commit ca5947b

Browse files
committed
Change to bounded behavior per PR suggestions
1 parent 830b101 commit ca5947b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/zmq/certificate.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ bool certificate::create(config::sodium& out_public,
7979
{
8080
// Loop until neither key's base85 encoding includes the # character.
8181
// This ensures that the value can be used in libbitcoin settings files.
82-
while (true)
82+
for (uint8_t attempt = 0; attempt < max_uint8; attempt++)
8383
{
8484
char public_key[zmq_encoded_key_size + 1] = { 0 };
8585
char private_key[zmq_encoded_key_size + 1] = { 0 };
@@ -95,6 +95,8 @@ bool certificate::create(config::sodium& out_public,
9595
return out_public;
9696
}
9797
}
98+
99+
return false;
98100
}
99101

100102
certificate::operator bool() const

0 commit comments

Comments
 (0)