diff --git a/src/lib/ares_options.c b/src/lib/ares_options.c index f34561bf..649487dd 100644 --- a/src/lib/ares_options.c +++ b/src/lib/ares_options.c @@ -435,7 +435,8 @@ ares_status_t ares__init_by_options(ares_channel_t *channel, } if (optmask & ARES_OPT_QUERY_CACHE) { - if (options->qcache_max_ttl <= 0) { + /* qcache_max_ttl is unsigned unlike the others */ + if (options->qcache_max_ttl == 0) { optmask &= ~(ARES_OPT_QUERY_CACHE); } else { channel->qcache_max_ttl = options->qcache_max_ttl;