diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-21 09:50:19 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-03-21 11:54:08 +0100 |
commit | ca4e4506dba014341a099f043f51bb6afd33d520 (patch) | |
tree | c539dfd3cd422909fa776107e100a0419e212b4d /core | |
parent | cce0a27ec7dd7c11fcb37eb724b0b7e97b3b1478 (diff) |
Fix potential divisions by 0 reported by MSVC
The `TextEdit` one was indeed a potential bug.
The `PCKPacker` one seems to be a false positive, it's already in a
`for` loop that depends on `files.size()`.
Diffstat (limited to 'core')
-rw-r--r-- | core/io/pck_packer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index fb83f0ac90..11e537c10b 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -163,7 +163,7 @@ Error PCKPacker::flush(bool p_verbose) { src->close(); memdelete(src); count += 1; - if (p_verbose) { + if (p_verbose && files.size() > 0) { if (count % 100 == 0) { printf("%i/%i (%.2f)\r", count, files.size(), float(count) / files.size() * 100); fflush(stdout); |