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')
-rw-r--r--source/blender/python/api2_2x/Scene.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Scene.c b/source/blender/python/api2_2x/Scene.c
index eba951b8813..edb5e015eea 100644
--- a/source/blender/python/api2_2x/Scene.c
+++ b/source/blender/python/api2_2x/Scene.c
@@ -635,16 +635,19 @@ static PyObject *M_Scene_New( PyObject * self, PyObject * args,
/*-----------------------Scene.Get()------------------------------------*/
static PyObject *M_Scene_Get( PyObject * self, PyObject * args )
{
- char *name = NULL;
+ char *tname = NULL, name[22];
Scene *scene_iter;
- if( !PyArg_ParseTuple( args, "|s", &name ) )
+ if( !PyArg_ParseTuple( args, "|s", &tname ) )
return ( EXPP_ReturnPyObjError( PyExc_TypeError,
"expected string argument (or nothing)" ) );
+ strncpy(name, tname, 21);
+ if( strlen(tname) >= 21 ) name[21]= 0;
+
scene_iter = G.main->scene.first;
- if( name ) { /* (name) - Search scene by name */
+ if( tname ) { /* (name) - Search scene by name */
PyObject *wanted_scene = NULL;