summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/ustring.cpp9
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];
}
}