diff --git a/src/lib/ares__threads.c b/src/lib/ares__threads.c index 028790ae..ecff3301 100644 --- a/src/lib/ares__threads.c +++ b/src/lib/ares__threads.c @@ -335,8 +335,8 @@ static void ares__timespec_timeout(struct timespec *ts, unsigned long add_ms) # error cannot determine current system time # endif - ts->tv_sec += add_ms / 1000; - ts->tv_nsec += (add_ms % 1000) * 1000000; + ts->tv_sec += (time_t)(add_ms / 1000); + ts->tv_nsec += (long)((add_ms % 1000) * 1000000); /* Normalize if needed */ if (ts->tv_nsec >= 1000000000) {