diff --git a/core/ustring.cpp b/core/ustring.cpp index 5aba93ddf..6063083a5 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3571,7 +3571,7 @@ String String::path_clean_end_slash() const { String ret = *this; while (ret.length() > 1 && (ret.ends_with("/") || ret.ends_with("\\"))) { - ret.resize(length() - 1); + ret.resize(ret.length()); } return ret;