cleanup some BLF macros and dont over-alloc BGE's PyObjectPlus when setting strings (better change then the one I made recently).

This commit is contained in:
2011-11-04 09:14:49 +00:00
parent 3717059511
commit 2d09bf85af
2 changed files with 19 additions and 18 deletions

View File

@@ -1042,8 +1042,8 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt
else if (val_len > attrdef->m_imax)
{
// trim the string
*var = val;
var->SetLength(attrdef->m_imax);
memcpy(var->Ptr(), val, attrdef->m_imax - 1);
break;
}
} else if (val_len < attrdef->m_imin || val_len > attrdef->m_imax)