Skip to content

Commit 8511b64

Browse files
Stefan Krausekdudka
authored andcommitted
transfer: avoid insane conversion of time_t
1 parent 17de1cc commit 8511b64

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

lib/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ static CURLcode file_do(struct connectdata *conn, bool *done)
464464
}
465465

466466
if(fstated && !data->state.range && data->set.timecondition) {
467-
if(!Curl_meets_timecondition(data, data->info.filetime)) {
467+
if(!Curl_meets_timecondition(data, (time_t)data->info.filetime)) {
468468
*done = TRUE;
469469
return CURLE_OK;
470470
}

lib/transfer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static void read_rewind(struct connectdata *conn,
359359
* Check to see if CURLOPT_TIMECONDITION was met by comparing the time of the
360360
* remote document with the time provided by CURLOPT_TIMEVAL
361361
*/
362-
bool Curl_meets_timecondition(struct SessionHandle *data, long timeofdoc)
362+
bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc)
363363
{
364364
if((timeofdoc == 0) || (data->set.timevalue == 0))
365365
return TRUE;

lib/transfer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ CURLcode Curl_readrewind(struct connectdata *conn);
4747
CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp);
4848
CURLcode Curl_reconnect_request(struct connectdata **connp);
4949
CURLcode Curl_retry_request(struct connectdata *conn, char **url);
50-
bool Curl_meets_timecondition(struct SessionHandle *data, long timeofdoc);
50+
bool Curl_meets_timecondition(struct SessionHandle *data, time_t timeofdoc);
5151

5252
/* This sets up a forthcoming transfer */
5353
void

0 commit comments

Comments
 (0)