summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authordankan1890 <mewuidev2@gmail.com>2020-02-03 17:59:24 +0100
committerdankan1890 <mewuidev2@gmail.com>2020-02-03 17:59:24 +0100
commitca0ee767cb5f93420b456fa47422ae2b3e266b4f (patch)
tree1301e2224fdbaefc0d541d2b4629c4aaed9895f7 /core
parent0edcb8ed58be8bf6a5145ceaae5ff96778afb2a2 (diff)
Fixed String::humanize_size crash.
Close #35872
Diffstat (limited to 'core')
-rw-r--r--core/ustring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 8a1fbfd383..08418463a0 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3324,7 +3324,7 @@ String String::humanize_size(uint64_t p_size) {
int prefix_idx = 0;
- while (prefix_idx < prefixes.size() && p_size > (_div * 1024)) {
+ while (prefix_idx < prefixes.size() - 1 && p_size > (_div * 1024)) {
_div *= 1024;
prefix_idx++;
}