Skip to content

Commit

Permalink
xrCore/FS.cpp: r_bytes can be 0 if the file_size is 0 (fixes #1572)
Browse files Browse the repository at this point in the history
Mandatory condition for r_bytes to be greater than 0 was introduced in
#1512 and #1523, this commit reverts the check to original one.
  • Loading branch information
Xottab-DUTY committed Feb 15, 2024
1 parent 5efa5fb commit 63b559e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xrCore/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ void* FileDownload(pcstr file_name, const int& file_handle, size_t& file_size)
VERIFY(file_size != 0);
void* buffer = xr_malloc(file_size);

const ssize_t r_bytes = _read(file_handle, buffer, file_size);
R_ASSERT3(r_bytes > 0 && static_cast<size_t>(r_bytes) == file_size, "Can't read from file : ", file_name);
const auto r_bytes = _read(file_handle, buffer, file_size);
R_ASSERT3(file_size == static_cast<size_t>(r_bytes), "Can't read from file : ", file_name);

// file_size = r_bytes;

Expand Down

0 comments on commit 63b559e

Please sign in to comment.