diff --git a/lib/http.c b/lib/http.c
index 5be8a9e6f080527069a6fa29632a4231fcf48e13..66e38bf942d4c171457835c4eb37f2c3a7b076b6 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1259,7 +1259,7 @@ CURLcode Curl_http(struct connectdata *conn)
          input. If we knew it was a proper file we could've just
          fseek()ed but we only have a stream here */
       do {
-        size_t readthisamountnow = (conn->resume_from - passed);
+        size_t readthisamountnow = (size_t)(conn->resume_from - passed);
         size_t actuallyread;
 
         if(readthisamountnow > BUFSIZE)