diff --git a/core/ustring.cpp b/core/ustring.cpp index 8a1fbfd3836..08418463a0a 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++; }