aboutsummaryrefslogtreecommitdiff
path: root/core/ustring.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2015-06-30 11:59:00 -0300
committerJuan Linietsky2015-06-30 11:59:00 -0300
commit4613a3f2c0d8f060cac610e2a7a401aee2ece78f (patch)
tree4a2f4c935988137a9e8a6f7855582b9b9a3e5d97 /core/ustring.cpp
parent95047562d743b1c1fdc007432c8a0c145a455c5d (diff)
downloadgodot-4613a3f2c0d8f060cac610e2a7a401aee2ece78f.tar.gz
godot-4613a3f2c0d8f060cac610e2a7a401aee2ece78f.tar.zst
godot-4613a3f2c0d8f060cac610e2a7a401aee2ece78f.zip
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r--core/ustring.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 945c84156..3cfc1e4a3 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];
}
}