diff --git a/src/tool_writeout.c b/src/tool_writeout.c index 39acac8f69..185b835125 100644 --- a/src/tool_writeout.c +++ b/src/tool_writeout.c @@ -572,7 +572,7 @@ static const char *outtime(const char *ptr, /* %time{ ... */ if(timestr) { curl_off_t val; curlx_str_number(×tr, &val, TIME_T_MAX); - cnow.tv_sec = (time_t)val; + cnow.tv_sec = (val < TIME_T_MAX) ? (time_t)val : TIME_T_MAX; cnow.tv_usec = (unsigned int)(val % 1000000); } }