summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2020-12-15 19:07:43 +0100
committerGitHub <noreply@github.com>2020-12-15 19:07:43 +0100
commitf26a765637acea98b4745d4b17d1e82961b267c1 (patch)
tree220a6b11c5623b331a444c867da55560135003ba
parent0415a2d913fef3a0f352c8d62c6644fdfa6acb75 (diff)
parentc65f097ebd6be6743f4fa8fd27d4d82bbd28d005 (diff)
Merge pull request #44400 from andy-noisyduck/master
Fix incorrect error messages when writing to compressed or encrypted files
-rw-r--r--core/io/file_access_compressed.cpp4
-rw-r--r--core/io/file_access_encrypted.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/core/io/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index 4424192af2..b06b3c078f 100644
--- a/core/io/file_access_compressed.cpp
+++ b/core/io/file_access_compressed.cpp
@@ -327,14 +327,14 @@ Error FileAccessCompressed::get_error() const {
void FileAccessCompressed::flush() {
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
- ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
+ ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
// compressed files keep data in memory till close()
}
void FileAccessCompressed::store_8(uint8_t p_dest) {
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
- ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
+ ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
WRITE_FIT(1);
write_ptr[write_pos++] = p_dest;
diff --git a/core/io/file_access_encrypted.cpp b/core/io/file_access_encrypted.cpp
index 2ac24d5169..cf5800b472 100644
--- a/core/io/file_access_encrypted.cpp
+++ b/core/io/file_access_encrypted.cpp
@@ -256,7 +256,7 @@ Error FileAccessEncrypted::get_error() const {
}
void FileAccessEncrypted::store_buffer(const uint8_t *p_src, int p_length) {
- ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
+ ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
if (pos < data.size()) {
for (int i = 0; i < p_length; i++) {
@@ -272,13 +272,13 @@ void FileAccessEncrypted::store_buffer(const uint8_t *p_src, int p_length) {
}
void FileAccessEncrypted::flush() {
- ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
+ ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
// encrypted files keep data in memory till close()
}
void FileAccessEncrypted::store_8(uint8_t p_dest) {
- ERR_FAIL_COND_MSG(!writing, "File has not been opened in read mode.");
+ ERR_FAIL_COND_MSG(!writing, "File has not been opened in write mode.");
if (pos < data.size()) {
data.write[pos] = p_dest;