Skip to content

Commit

Permalink
Everywhere: Replace a bundle of dbg with dbgln.
Browse files Browse the repository at this point in the history
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.

The modifications in this commit were automatically made using the
following command:

    find . -name '*.h' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
  • Loading branch information
asynts authored and awesomekling committed Jan 11, 2021
1 parent a410bb8 commit 6fa42af
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Libraries/LibCrypto/ASN1/DER.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ static inline bool der_decode_sequence(const u8* in, size_t in_length, ASN1::Lis
case ASN1::Kind::Integer:
z = in_length;
if (!der_decode_integer(in + x, z, *(UnsignedBigInteger*)data)) {
dbg() << "could not decode an integer";
dbgln("could not decode an integer");
return false;
}
if (!der_length_integer((UnsignedBigInteger*)data, &z)) {
dbg() << "could not figure out the length";
dbgln("could not figure out the length");
return false;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibCrypto/PK/Code/EMSA_PSS.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class EMSA_PSS : public Code<HashFunction> {
AK::fill_with_random(salt, SaltLength);

if (em_length < hash_length + SaltLength + 2) {
dbg() << "Ooops...encoding error";
dbgln("Ooops...encoding error");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibCrypto/PK/RSA.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class RSA : public PKSystem<RSAPrivateKey<IntegerType>, RSAPublicKey<IntegerType
p = NumberTheory::random_big_prime(bits / 2);
q = NumberTheory::random_big_prime(bits / 2);
lambda = NumberTheory::LCM(p.minus(1), q.minus(1));
dbg() << "checking combination p=" << p << ", q=" << q << ", lambda=" << lambda.length();
dbgln("checking combination p={}, q={}, lambda={}", p, q, lambda.length());
} while (!(NumberTheory::GCD(e, lambda) == 1));

auto n = p.multiplied_by(q);
Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibRegex/RegexDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class RegexDebug {
for (;;) {
auto* opcode = bytecode.get_opcode(state);
if (!opcode) {
dbg() << "Wrong opcode... failed!";
dbgln("Wrong opcode... failed!");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion Libraries/LibTLS/TLSv12.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ class TLSv12 : public Core::Socket {
void set_sni(const StringView& sni)
{
if (m_context.is_server || m_context.critical_error || m_context.connection_status != ConnectionStatus::Disconnected) {
dbg() << "invalid state for set_sni";
dbgln("invalid state for set_sni");
return;
}
m_context.SNI = sni;
Expand Down

0 comments on commit 6fa42af

Please sign in to comment.