Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/api2_2x/NLA.c')
-rw-r--r--source/blender/python/api2_2x/NLA.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/NLA.c b/source/blender/python/api2_2x/NLA.c
index ce69f42275f..36a7ab2a422 100644
--- a/source/blender/python/api2_2x/NLA.c
+++ b/source/blender/python/api2_2x/NLA.c
@@ -260,6 +260,7 @@ static PyObject *Action_getName( BPy_Action * self )
static PyObject *Action_setName( BPy_Action * self, PyObject * args )
{
char *name;
+ char buf[21];
if( !self->action )
( EXPP_ReturnPyObjError( PyExc_RuntimeError,
@@ -270,10 +271,10 @@ static PyObject *Action_setName( BPy_Action * self, PyObject * args )
"expected string argument" ) );
//change name
- strcpy( self->action->id.name + 2, name );
+ PyOS_snprintf( buf, sizeof( buf ), "%s", name );
+ rename_id( &self->action->id, buf);
- Py_INCREF( Py_None );
- return Py_None;
+ Py_RETURN_NONE;
}
static PyObject *Action_setActive( BPy_Action * self, PyObject * args )