Fixing bugs in future:
DNA reconstruct now terminates strings, when the new string in a file is longer than in current definition. This will enable a safer ID and other name lengthening, keeping at least some forward compitability.
This commit is contained in:
@@ -869,6 +869,10 @@ static void reconstruct_elem(SDNA *newsdna, SDNA *oldsdna, char *type, const cha
|
||||
mul= len/oldsize;
|
||||
mul*= (cursize < oldsize)? cursize: oldsize;
|
||||
memcpy(curdata, olddata, mul);
|
||||
|
||||
/* terminate strings */
|
||||
if(oldsize > cursize && strcmp(type, "char")==0)
|
||||
curdata[mul-1]= 0;
|
||||
}
|
||||
else {
|
||||
if(cursize>oldsize) cast_elem(type, otype, oname, curdata, olddata);
|
||||
|
||||
Reference in New Issue
Block a user