diff --git a/src/storage.cpp b/src/storage.cpp index 26bc8d2b6..5cca457ac 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -1191,7 +1191,10 @@ ret: } if (file_bytes_left != bytes_transferred) - return bytes_transferred; + { + set_error(combine_path(m_save_path, files().file_path(*file_iter)), errors::file_too_short); + return -1; + } advance_bufs(current_buf, bytes_transferred); TORRENT_ASSERT(count_bufs(current_buf, bytes_left - file_bytes_left) <= num_bufs);