We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8c56da commit 9a604e7Copy full SHA for 9a604e7
api/String.cpp
@@ -199,6 +199,7 @@ String & String::copy(const char *cstr, unsigned int length)
199
}
200
len = length;
201
memcpy(buffer, cstr, length);
202
+ buffer[len] = '\0';
203
return *this;
204
205
@@ -220,6 +221,7 @@ void String::move(String &rhs)
220
221
if (rhs && capacity >= rhs.len) {
222
memcpy(buffer, rhs.buffer, rhs.len);
223
len = rhs.len;
224
225
rhs.len = 0;
226
return;
227
} else {
@@ -292,6 +294,7 @@ unsigned char String::concat(const char *cstr, unsigned int length)
292
294
if (!reserve(newlen)) return 0;
293
295
memcpy(buffer + len, cstr, length);
296
len = newlen;
297
298
return 1;
299
300
0 commit comments