LibDNS: Fix compilation with signed time_t

With signed 32-bit time_t, the type of time_t + m_ttl is unsigned int,
which results in -Werror=sign-compare. Fix this by explicitly casting
it back to time_t.
This commit is contained in:
Sergey Bugaev 2023-09-03 18:01:54 +03:00 committed by Andrew Kaster
parent fcced97509
commit 976d93d910
Notes: sideshowbarker 2024-07-17 08:37:36 +09:00

View File

@ -24,7 +24,7 @@ Answer::Answer(Name const& name, RecordType type, RecordClass class_code, u32 tt
bool Answer::has_expired() const
{
return time(nullptr) >= m_received_time + m_ttl;
return time(nullptr) >= static_cast<time_t>(m_received_time + m_ttl);
}
unsigned Answer::hash() const