diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-02-01 00:24:19 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-02-01 07:50:59 +0100 |
commit | ddd31dc5dd960c4bd4dc995aec5178fddb24bfef (patch) | |
tree | 34f9466202037ebe09108216ce6488cd3ba2d0fb /lib | |
parent | 9409d0c26c7d46cde20beaec09ef0babb10f3794 (diff) | |
download | curl-ddd31dc5dd960c4bd4dc995aec5178fddb24bfef.tar.gz |
time_t-fixes: remove typecasts to 'long' for info.filetime
They're now wrong.
Reported-by: Michael Kaufmann
Closes #2277
Diffstat (limited to 'lib')
-rw-r--r-- | lib/file.c | 6 | ||||
-rw-r--r-- | lib/ftp.c | 6 | ||||
-rw-r--r-- | lib/http.c | 2 | ||||
-rw-r--r-- | lib/ssh-libssh.c | 4 | ||||
-rw-r--r-- | lib/ssh.c | 4 |
5 files changed, 11 insertions, 11 deletions
diff --git a/lib/file.c b/lib/file.c index 528f34afb..db04cc2da 100644 --- a/lib/file.c +++ b/lib/file.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -403,12 +403,12 @@ static CURLcode file_do(struct connectdata *conn, bool *done) /* we could stat it, then read out the size */ expected_size = statbuf.st_size; /* and store the modification time */ - data->info.filetime = (long)statbuf.st_mtime; + data->info.filetime = statbuf.st_mtime; fstated = TRUE; } if(fstated && !data->state.range && data->set.timecondition) { - if(!Curl_meets_timecondition(data, (time_t)data->info.filetime)) { + if(!Curl_meets_timecondition(data, data->info.filetime)) { *done = TRUE; return CURLE_OK; } @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -2061,7 +2061,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn, "%04d%02d%02d %02d:%02d:%02d GMT", year, month, day, hour, minute, second); /* now, convert this into a time() value: */ - data->info.filetime = (long)curl_getdate(timebuf, &secs); + data->info.filetime = curl_getdate(timebuf, &secs); } #ifdef CURL_FTP_HTTPSTYLE_HEAD @@ -2073,7 +2073,7 @@ static CURLcode ftp_state_mdtm_resp(struct connectdata *conn, data->set.get_filetime && (data->info.filetime >= 0) ) { char headerbuf[128]; - time_t filetime = (time_t)data->info.filetime; + time_t filetime = data->info.filetime; struct tm buffer; const struct tm *tm = &buffer; diff --git a/lib/http.c b/lib/http.c index a5007670d..ac8f8ea92 100644 --- a/lib/http.c +++ b/lib/http.c @@ -3692,7 +3692,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data, k->timeofdoc = curl_getdate(k->p + strlen("Last-Modified:"), &secs); if(data->set.get_filetime) - data->info.filetime = (long)k->timeofdoc; + data->info.filetime = k->timeofdoc; } else if((checkprefix("WWW-Authenticate:", k->p) && (401 == k->httpcode)) || diff --git a/lib/ssh-libssh.c b/lib/ssh-libssh.c index 56775d70d..d821c4a37 100644 --- a/lib/ssh-libssh.c +++ b/lib/ssh-libssh.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 2017 Red Hat, Inc. + * Copyright (C) 2017 - 2018 Red Hat, Inc. * * Authors: Nikos Mavrogiannopoulos, Tomas Mraz, Stanislav Zidek, * Robert Kolcun, Andreas Schneider @@ -1046,7 +1046,7 @@ static CURLcode myssh_statemach_act(struct connectdata *conn, bool *block) attrs = sftp_stat(sshc->sftp_session, protop->path); if(attrs != 0) { - data->info.filetime = (long)attrs->mtime; + data->info.filetime = attrs->mtime; sftp_attributes_free(attrs); } @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -1627,7 +1627,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block) break; } if(rc == 0) { - data->info.filetime = (long)attrs.mtime; + data->info.filetime = attrs.mtime; } state(conn, SSH_SFTP_TRANS_INIT); |