diff options
author | Yang Tse <yangsita@gmail.com> | 2012-12-05 17:28:32 +0100 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2012-12-05 17:28:32 +0100 |
commit | 60edbf65b6d1bfd264e10a72cd35fb81bfad7b8d (patch) | |
tree | aa0b83f21e9d90bca434bcbf79456a9704d746f0 /tests/libtest/lib1502.c | |
parent | fe2b2a3b9dbe18883cf7c9789cd958915978dc3a (diff) | |
download | gnurl-60edbf65b6d1bfd264e10a72cd35fb81bfad7b8d.tar.gz gnurl-60edbf65b6d1bfd264e10a72cd35fb81bfad7b8d.tar.bz2 gnurl-60edbf65b6d1bfd264e10a72cd35fb81bfad7b8d.zip |
libtest: fix some compiler warnings
Diffstat (limited to 'tests/libtest/lib1502.c')
-rw-r--r-- | tests/libtest/lib1502.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/libtest/lib1502.c b/tests/libtest/lib1502.c index ec1058826..bb008f17c 100644 --- a/tests/libtest/lib1502.c +++ b/tests/libtest/lib1502.c @@ -26,6 +26,10 @@ #include "test.h" +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif + #include <stdio.h> #include <string.h> @@ -92,11 +96,12 @@ int test(char *URL) curl_multi_timeout(multi_handle, &curl_timeo); if(curl_timeo >= 0) { - timeout.tv_sec = curl_timeo / 1000; + int itimeout = (curl_timeo > (long)INT_MAX) ? INT_MAX : (int)curl_timeo; + timeout.tv_sec = itimeout / 1000; if(timeout.tv_sec > 1) timeout.tv_sec = 1; else - timeout.tv_usec = (curl_timeo % 1000) * 1000; + timeout.tv_usec = (itimeout % 1000) * 1000; } /* get file descriptors from the transfers */ |