summaryrefslogtreecommitdiffstats
path: root/drivers/unix/file_access_unix.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-06-07 22:33:01 +0200
committerGitHub <noreply@github.com>2021-06-07 22:33:01 +0200
commitd92e46233ca7236fd8d3ac49915e378b883298e4 (patch)
tree40757c0444a7ee25c43f4dd15bf516e538fb91e0 /drivers/unix/file_access_unix.cpp
parenta19439734e0efcd764b3da81bb238c6cd8c10b6d (diff)
parent01d5c463be103a29662d2123cd37ae2f21b077a6 (diff)
downloadredot-engine-d92e46233ca7236fd8d3ac49915e378b883298e4.tar.gz
Merge pull request #49394 from akien-mga/fileaccess-store_buffer-err-len-0
FileAccess: Don't err in `store_buffer` with buffer of size 0
Diffstat (limited to 'drivers/unix/file_access_unix.cpp')
-rw-r--r--drivers/unix/file_access_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index ec23df62d0..6ea55219bb 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -264,7 +264,7 @@ void FileAccessUnix::store_8(uint8_t p_dest) {
void FileAccessUnix::store_buffer(const uint8_t *p_src, uint64_t p_length) {
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
- ERR_FAIL_COND(!p_src);
+ ERR_FAIL_COND(!p_src && p_length > 0);
ERR_FAIL_COND(fwrite(p_src, 1, p_length, f) != p_length);
}