mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Return an empty string in substr if len is 0.
This commit is contained in:
parent
772dd028d9
commit
3b4d7a723d
@ -174,6 +174,10 @@ void String::get_substr_nt(char *into_buf, const int start_index, const int len)
|
||||
}
|
||||
|
||||
String String::substr(const int start_index, const int len) const {
|
||||
if (len == 0) {
|
||||
return String();
|
||||
}
|
||||
|
||||
ERR_FAIL_INDEX_V(start_index, _size, String());
|
||||
|
||||
int sil = start_index + len;
|
||||
|
Loading…
Reference in New Issue
Block a user