mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 21:22:48 +00:00
Fix wrong bounds check in String::right
This commit is contained in:
parent
f5f2b5d4af
commit
597aac382b
@ -2945,12 +2945,12 @@ String String::left(int p_pos) const {
|
|||||||
|
|
||||||
String String::right(int p_pos) const {
|
String String::right(int p_pos) const {
|
||||||
|
|
||||||
if (p_pos >= size())
|
if (p_pos >= length())
|
||||||
return *this;
|
|
||||||
|
|
||||||
if (p_pos < 0)
|
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
if (p_pos <= 0)
|
||||||
|
return *this;
|
||||||
|
|
||||||
return substr(p_pos, (length() - p_pos));
|
return substr(p_pos, (length() - p_pos));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user