diff options
| author | Juan Linietsky | 2016-01-03 17:14:28 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-01-03 17:14:28 -0300 |
| commit | e8fbf39f886b2b5dbf5e14f07cd1dbefe8d48bf4 (patch) | |
| tree | f767c7db6b089cdc6d4c56cce09a2c65fa68e274 /core/ustring.cpp | |
| parent | b988f016fd2ae1fc6fab4daa1eb580e1446dbd8d (diff) | |
| download | godot-e8fbf39f886b2b5dbf5e14f07cd1dbefe8d48bf4.tar.gz godot-e8fbf39f886b2b5dbf5e14f07cd1dbefe8d48bf4.tar.zst godot-e8fbf39f886b2b5dbf5e14f07cd1dbefe8d48bf4.zip | |
Diffstat (limited to 'core/ustring.cpp')
| -rw-r--r-- | core/ustring.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index c93fb80ca..21c0d78fd 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -1636,12 +1636,16 @@ int64_t String::to_int64() const { return integer*sign; } -int String::to_int(const char* p_str) { +int String::to_int(const char* p_str,int p_len) { int to=0; - while(p_str[to]!=0 && p_str[to]!='.') - to++; + if (p_len>=0) + to=p_len; + else { + while(p_str[to]!=0 && p_str[to]!='.') + to++; + } int integer=0; |
