diff options
author | Ton Roosendaal <ton@blender.org> | 2005-10-21 00:38:08 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-10-21 00:38:08 +0400 |
commit | 968b3e71013e5afa1235977ba10f81e7e2a702a6 (patch) | |
tree | 32ac16c3eb8d3afb551d4fce629e1b5f28fb43e9 /source/blender/src/editdeform.c | |
parent | c677ffdebbc977aee21c8af97d09d4aeb6c2f2dc (diff) |
Memory error 'end corrupt' reports for deform groups... can't find it yet,
but this code ensures the strcpy() is using BLI_strncpy now, and it uses
more clear names for the mallocs.
Diffstat (limited to 'source/blender/src/editdeform.c')
-rw-r--r-- | source/blender/src/editdeform.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c index 36709948be9..3ae10500c72 100644 --- a/source/blender/src/editdeform.c +++ b/source/blender/src/editdeform.c @@ -144,14 +144,9 @@ bDeformGroup *add_defgroup_name (Object *ob, char *name) if (!ob) return NULL; - defgroup = MEM_callocN (sizeof(bDeformGroup), "deformGroup"); + defgroup = MEM_callocN (sizeof(bDeformGroup), "add deformGroup"); - /* I think there should be some length - * checking here -- don't know why NaN - * never checks name lengths (see - * unique_vertexgroup_name, for example). - */ - strcpy (defgroup->name, name); + BLI_strncpy (defgroup->name, name, 32); BLI_addtail(&ob->defbase, defgroup); unique_vertexgroup_name(defgroup, ob); @@ -606,7 +601,7 @@ void unique_vertexgroup_name (bDeformGroup *dg, Object *ob) } } if (!exists){ - strcpy (dg->name, tempname); + BLI_strncpy (dg->name, tempname, 32); return; } } |