aboutsummaryrefslogtreecommitdiff
path: root/lib/gopher.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-04-15 10:27:20 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-04-23 15:57:23 +0200
commita96c7529eb31498a464910935a7d1a5e88ce3914 (patch)
treefbdbc3fbdcd5eb701cdd7946e93edaa46d48cf77 /lib/gopher.c
parentb1b96926148758c6a8de0898269c11b0e555ed66 (diff)
select: make Curl_socket_check take timediff_t timeout
Coverity found CID 1461718: Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms > 9223372036854775807L" is always false regardless of the values of its operands. This occurs as the logical second operand of "||". Closes #5240
Diffstat (limited to 'lib/gopher.c')
-rw-r--r--lib/gopher.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gopher.c b/lib/gopher.c
index 4216e6136..c48098f75 100644
--- a/lib/gopher.c
+++ b/lib/gopher.c
@@ -147,8 +147,8 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
result = CURLE_OPERATION_TIMEDOUT;
break;
}
- if(!timeout_ms || timeout_ms > TIME_T_MAX)
- timeout_ms = TIME_T_MAX;
+ if(!timeout_ms)
+ timeout_ms = TIMEDIFF_T_MAX;
/* Don't busyloop. The entire loop thing is a work-around as it causes a
BLOCKING behavior which is a NO-NO. This function should rather be
@@ -156,7 +156,7 @@ static CURLcode gopher_do(struct connectdata *conn, bool *done)
possible to send now will be sent in the doing function repeatedly
until the entire request is sent.
*/
- what = SOCKET_WRITABLE(sockfd, (time_t)timeout_ms);
+ what = SOCKET_WRITABLE(sockfd, timeout_ms);
if(what < 0) {
result = CURLE_SEND_ERROR;
break;