Server/Database: Reduce differences between 3.3.5 and 6.x branches

This commit is contained in:
Aokromes
2016-08-10 17:48:25 +02:00
parent 085dd6a21d
commit 5db8edd611
5 changed files with 57 additions and 16 deletions

View File

@@ -47,10 +47,10 @@ void Field::SetStructuredValue(char* newValue, enum_field_types newType)
// This value stores somewhat structured data that needs function style casting
if (newValue)
{
size_t size = strlen(newValue);
data.value = new char [size+1];
strcpy((char*)data.value, newValue);
data.length = size;
data.value = new char[length + 1];
memcpy(data.value, newValue, length);
*(reinterpret_cast<char*>(data.value) + length) = '\0';
data.length = length;
}
data.type = newType;