Skip to content
Browse files

Fix off-by-one

  • Loading branch information...
1 parent 724d0a1 commit cb283607b9584e7f87c1784f02990a8a8d24c023 @gianm committed Jan 18, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 c/http.c
View
2 c/http.c
@@ -410,7 +410,7 @@ size_t range_fetch_read_http_headers( void *ptr, size_t size, size_t nmemb, void
/* HTTP 200 + Content-Length -> Entire file */
else if( rf->http_code == 200 && len > strlen("content-length: x") && strncasecmp(buf, "content-length: ", strlen("content-length: ")) == 0) {
- off_t to = (off_t)strtoll(buf + strlen("content-length: "), (void*)(buf + len), 10);
+ off_t to = (off_t)strtoll(buf + strlen("content-length: "), (void*)(buf + len), 10) - 1;
/* Found to, and from = 0 */
if( range_fetch_expect( rf, 0, to ) != 0 ) {

0 comments on commit cb28360

Please sign in to comment.
Something went wrong with that request. Please try again.