Dont allocate the string again during direct copy
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4358 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
9bffb40f82
commit
496e781146
|
@ -1014,10 +1014,6 @@ BOOL interpCopyValue(INTERP_VAL *to, INTERP_VAL *from)
|
|||
switch (to->type)
|
||||
{
|
||||
case VAL_STRING:
|
||||
free(to->v.sval);
|
||||
to->v.sval = malloc(MAXSTRLEN);
|
||||
if (to->v.sval == NULL)
|
||||
return false;
|
||||
return (strlcpy(to->v.sval, from->v.sval, MAXSTRLEN) != 0);
|
||||
default:
|
||||
return (memcpy(&(to->v), &(from->v), sizeof(to->v)) != NULL);
|
||||
|
|
Loading…
Reference in New Issue