mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
Replacing strcpy with memcpy - should be slightly faster because we're forced to know strlen, so no need in byte-by-byte copying
This commit is contained in:
parent
647e22bf81
commit
74209edb7d
@ -3159,8 +3159,9 @@ Machine::Machine(System* system, Heap* heap, Finder* bootFinder,
|
||||
this->properties = (char**)heap->allocate(sizeof(char*) * propertyCount);
|
||||
for (unsigned int i = 0; i < propertyCount; i++)
|
||||
{
|
||||
this->properties[i] = (char*)heap->allocate(sizeof(char) * (strlen(properties[i]) + 1));
|
||||
strcpy(this->properties[i], properties[i]);
|
||||
size_t length = strlen(properties[i]) + 1; // +1 for null-terminating char
|
||||
this->properties[i] = (char*)heap->allocate(sizeof(char) * length);
|
||||
memcpy(this->properties[i], properties[i], length);
|
||||
}
|
||||
|
||||
const char* bootstrapProperty = findProperty(this, BOOTSTRAP_PROPERTY);
|
||||
|
Loading…
Reference in New Issue
Block a user