summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2010-08-11 00:06:20 +0200
committerDaniel Stenberg <daniel@haxx.se>2010-08-11 00:06:20 +0200
commit8348dd96ddb02098dfb0fb472df21c475302150c (patch)
tree5603d067b1aa332d0c9b98a76b89a8a81e41ba72
parent2596eb6d19a40a76598f2dc87607297c40dff55f (diff)
downloadgnurl-8348dd96ddb02098dfb0fb472df21c475302150c.tar.gz
gnurl-8348dd96ddb02098dfb0fb472df21c475302150c.tar.bz2
gnurl-8348dd96ddb02098dfb0fb472df21c475302150c.zip
warning: silence the compiler
warning: conversion to 'long int' from 'time_t' may alter its value ... on win64 when time_t is 64bit and long is 32bit.
-rw-r--r--lib/tftp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index a1c0e259c..38b77fa42 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -1171,17 +1171,18 @@ static long tftp_state_timeout(struct connectdata *conn, tftp_event_t *event)
(long)current, (long)state->max_time));
state->error = TFTP_ERR_TIMEOUT;
state->state = TFTP_STATE_FIN;
- return(0);
+ return 0;
}
else if (current > state->rx_time+state->retry_time) {
if (event)
*event = TFTP_EVENT_TIMEOUT;
time(&state->rx_time); /* update even though we received nothing */
- return(state->max_time-current);
- }
- else {
- return(state->max_time-current);
}
+
+ /* there's a typecast below here since 'time_t' may in fact be larger than
+ 'long', but we estimate that a 'long' will still be able to hold number
+ of seconds even if "only" 32 bit */
+ return (long) state->max_time-current;
}