summaryrefslogtreecommitdiff
path: root/core/io/marshalls.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/marshalls.cpp')
-rw-r--r--core/io/marshalls.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index c5d59f786d..e701a89c78 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -807,11 +807,16 @@ static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) {
encode_uint32(utf8.length(), buf);
buf += 4;
copymem(buf, utf8.get_data(), utf8.length());
+ buf += utf8.length();
}
r_len += 4 + utf8.length();
- while (r_len % 4)
+ while (r_len % 4) {
r_len++; //pad
+ if (buf) {
+ buf++;
+ }
+ }
}
Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_object_as_id) {