diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-12-09 10:23:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-09 10:23:21 +0100 |
commit | 0c5d3b838c935e6121bcee57b83fa802d7058cc1 (patch) | |
tree | de206bf06d4f6fb280a427a2a907de93f0043bed /core/io | |
parent | e5e1277ecd08f1f2980c9cd0490fb932efaa4678 (diff) | |
parent | 644f73966002589c36d779fa33b9524a451f56e0 (diff) |
Merge pull request #44199 from bruvzg/pvs_fixes_1
PVS-Studio static analyzer fixes
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/compression.cpp | 4 | ||||
-rw-r--r-- | core/io/file_access_zip.h | 2 | ||||
-rw-r--r-- | core/io/marshalls.cpp | 5 |
3 files changed, 3 insertions, 8 deletions
diff --git a/core/io/compression.cpp b/core/io/compression.cpp index cd8793bb0a..8e613cb3ce 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -257,13 +257,13 @@ int Compression::decompress_dynamic(Vector<uint8_t> *p_dst_vect, int p_max_dst_s } while (ret != Z_STREAM_END); // If all done successfully, resize the output if it's larger than the actual output - if (ret == Z_STREAM_END && (unsigned long)p_dst_vect->size() > strm.total_out) { + if ((unsigned long)p_dst_vect->size() > strm.total_out) { p_dst_vect->resize(strm.total_out); } // clean up and return (void)inflateEnd(&strm); - return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR; + return Z_OK; } int Compression::zlib_level = Z_DEFAULT_COMPRESSION; diff --git a/core/io/file_access_zip.h b/core/io/file_access_zip.h index eff07c60e2..f8e7c1e587 100644 --- a/core/io/file_access_zip.h +++ b/core/io/file_access_zip.h @@ -59,8 +59,6 @@ private: static ZipArchive *instance; - FileAccess::CreateFunc fa_create_func; - public: void close_handle(unzFile p_file) const; unzFile get_file_handle(String p_file) const; diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index 3cf4acaf39..db12fcb7f7 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -1003,10 +1003,7 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo } } break; - case Variant::STRING: { - _encode_string(p_variant, buf, r_len); - - } break; + case Variant::STRING: case Variant::STRING_NAME: { _encode_string(p_variant, buf, r_len); |