From ce10a5314a8cf435d152bee089e1e2e4b2fb3285 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 17 Mar 2022 10:41:02 -0500 Subject: [PATCH] fixup! fix: ensure all bytes read / written to file (#2682) (#2780) fix: infinite loop when pread returns 0 --- libtransmission/file-posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/file-posix.cc b/libtransmission/file-posix.cc index a7f79bd0c..bb114e091 100644 --- a/libtransmission/file-posix.cc +++ b/libtransmission/file-posix.cc @@ -786,7 +786,7 @@ bool tr_sys_file_read_at( static_assert(sizeof(*bytes_read) >= sizeof(my_bytes_read)); - if (my_bytes_read != -1) + if (my_bytes_read > 0) { if (bytes_read != nullptr) {