Skip to content

Commit

Permalink
explicit int checks
Browse files Browse the repository at this point in the history
(cherry picked from commit e8c23ea)
  • Loading branch information
Habbie committed Feb 28, 2025
1 parent 3e6f586 commit 048c260
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/lmdbbackend/lmdbbackend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ bool LMDBBackend::list(const DNSName& target, int /* id */, bool include_disable
d_matchkey = co(di.id);

MDBOutVal key, val;
if (d_getcursor->prefix(d_matchkey, key, val)) {
if (d_getcursor->prefix(d_matchkey, key, val) != 0) {
d_getcursor.reset();
}

Expand Down Expand Up @@ -1467,7 +1467,7 @@ void LMDBBackend::lookup(const QType& type, const DNSName& qdomain, int zoneId,
d_matchkey = co(zoneId, relqname, type.getCode());
}

if (d_getcursor->prefix(d_matchkey, key, val)) {
if (d_getcursor->prefix(d_matchkey, key, val) != 0) {
d_getcursor.reset();
if (d_dolog) {
g_log << Logger::Warning << "Query " << ((long)(void*)this) << ": " << d_dtime.udiffNoReset() << " us to execute (found nothing)" << endl;
Expand Down Expand Up @@ -1505,7 +1505,7 @@ bool LMDBBackend::get(DNSZoneRecord& zr)

if (zr.dr.d_type == QType::NSEC3) {
// Hit a magic NSEC3 skipping
if (d_getcursor->next(d_currentKey, d_currentVal)) {
if (d_getcursor->next(d_currentKey, d_currentVal) != 0) {
// cerr<<"resetting d_getcursor 1"<<endl;
d_getcursor.reset();
}
Expand Down Expand Up @@ -1533,7 +1533,7 @@ bool LMDBBackend::get(DNSZoneRecord& zr)

if (d_currentrrsetpos >= d_currentrrset.size()) {
d_currentrrset.clear(); // will invalidate lrr
if (d_getcursor->next(d_currentKey, d_currentVal)) {
if (d_getcursor->next(d_currentKey, d_currentVal) != 0) {
// cerr<<"resetting d_getcursor 2"<<endl;
d_getcursor.reset();
}
Expand Down Expand Up @@ -2420,7 +2420,7 @@ bool LMDBBackend::updateDNSSECOrderNameAndAuth(uint32_t domain_id, const DNSName

auto cursor = txn->txn->getCursor(txn->db->dbi);
MDBOutVal key, val;
if (cursor.prefix(matchkey, key, val)) {
if (cursor.prefix(matchkey, key, val) != 0) {
// cout << "Could not find anything"<<endl;
return false;
}
Expand Down

0 comments on commit 048c260

Please sign in to comment.