1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

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

View file

@ -24,7 +24,7 @@ Answer::Answer(Name const& name, RecordType type, RecordClass class_code, u32 tt
bool Answer::has_expired() const 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 unsigned Answer::hash() const