From 18a23ab8c91cecbbdfd2389453e1f8233c095075 Mon Sep 17 00:00:00 2001 From: Ken Hughes Date: Thu, 4 May 2006 13:42:12 +0000 Subject: ===Python API=== Bufgix #4171: Action_setName() didn't call rename_id(), messing up the internal database. Patch provided by Roland Hess (thanks). --- source/blender/python/api2_2x/NLA.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/python/api2_2x/NLA.c') 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 ) -- cgit v1.2.3