# HG changeset patch # User Paul Boddie # Date 1712433147 -7200 # Node ID 3047b11cc814b7d77c772af3552a11189b8909d1 # Parent eff120c8f9e3bf38da7de6b28ae296f8b261af46 Fixed the file_data_available result to return zero if the populated span has somehow become less than the current position in the memory region. diff -r eff120c8f9e3 -r 3047b11cc814 libfsclient/lib/src/file.cc --- a/libfsclient/lib/src/file.cc Tue Apr 02 23:58:31 2024 +0200 +++ b/libfsclient/lib/src/file.cc Sat Apr 06 21:52:27 2024 +0200 @@ -548,7 +548,10 @@ offset_t file_data_available(file_t *file) { - return file_populated_span(file) - file->data_current; + if (file_populated_span(file) > file->data_current) + return file_populated_span(file) - file->data_current; + else + return 0; } /* Return the current data offset in the region. */