Dont allocate the string again during direct copy

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4358 4a71c877-e1ca-e34f-864e-861f7616d084
master
Dennis Schridde 2008-03-26 15:37:16 +00:00
parent 9bffb40f82
commit 496e781146
1 changed files with 0 additions and 4 deletions

View File

@ -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);