summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-03-21 09:50:19 +0100
committerRémi Verschelde <rverschelde@gmail.com>2020-03-21 11:54:08 +0100
commitca4e4506dba014341a099f043f51bb6afd33d520 (patch)
treec539dfd3cd422909fa776107e100a0419e212b4d /core
parentcce0a27ec7dd7c11fcb37eb724b0b7e97b3b1478 (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.cpp2
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);