You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Don't memcpy to nullptr even if length is zero
This commit is contained in:
@@ -104,9 +104,11 @@ Error HTTPRequest::request(const String &p_url, const Vector<String> &p_custom_h
|
|||||||
|
|
||||||
CharString charstr = p_request_data.utf8();
|
CharString charstr = p_request_data.utf8();
|
||||||
size_t len = charstr.length();
|
size_t len = charstr.length();
|
||||||
|
if (len > 0) {
|
||||||
raw_data.resize(len);
|
raw_data.resize(len);
|
||||||
uint8_t *w = raw_data.ptrw();
|
uint8_t *w = raw_data.ptrw();
|
||||||
memcpy(w, charstr.ptr(), len);
|
memcpy(w, charstr.ptr(), len);
|
||||||
|
}
|
||||||
|
|
||||||
return request_raw(p_url, p_custom_headers, p_ssl_validate_domain, p_method, raw_data);
|
return request_raw(p_url, p_custom_headers, p_ssl_validate_domain, p_method, raw_data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,8 +249,10 @@ void SoftBody3DSW::update_area() {
|
|||||||
|
|
||||||
// Node area.
|
// Node area.
|
||||||
LocalVector<int> counts;
|
LocalVector<int> counts;
|
||||||
|
if (nodes.size() > 0) {
|
||||||
counts.resize(nodes.size());
|
counts.resize(nodes.size());
|
||||||
memset(counts.ptr(), 0, counts.size() * sizeof(int));
|
memset(counts.ptr(), 0, counts.size() * sizeof(int));
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0, ni = nodes.size(); i < ni; ++i) {
|
for (i = 0, ni = nodes.size(); i < ni; ++i) {
|
||||||
nodes[i].area = 0.0;
|
nodes[i].area = 0.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user