diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-06-30 11:59:00 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-06-30 11:59:00 -0300 |
commit | 4613a3f2c0d8f060cac610e2a7a401aee2ece78f (patch) | |
tree | 4a2f4c935988137a9e8a6f7855582b9b9a3e5d97 /core | |
parent | 95047562d743b1c1fdc007432c8a0c145a455c5d (diff) |
small fixes
Diffstat (limited to 'core')
-rw-r--r-- | core/ustring.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index 945c841568..3cfc1e4a3c 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -67,11 +67,14 @@ void String::copy_from(const char *p_cstr) { return; } + resize(len+1); // include 0 - for(int i=0;i<len+1;i++) { - - set(i,p_cstr[i]); + CharType *dst = this->ptr(); + + for (int i=0;i<len+1;i++) { + + dst[i]=p_cstr[i]; } } |