diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-01-22 06:50:09 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-01-22 06:50:09 +0300 |
commit | 799e9c48c1a210386873ae01a0f208675eafffe7 (patch) | |
tree | cabbf41a49c072f62336a41c4afde5dd302d2126 /source/blender/editors/armature | |
parent | f6d54bd1eed7a6d6382d237b7d2291c4ba495246 (diff) |
comment dead code and fix 2 missing NULL checks (pointer used after NULL check and checking against incorrect pointer before use).
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 2252c926c71..e0172b603b7 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -3000,14 +3000,13 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op) bArmature *arm= (obedit) ? obedit->data : NULL; Scene *scene= CTX_data_scene(C); View3D *v3d= CTX_wm_view3d(C); - EditBone *newbone=NULL; ListBase points = {NULL, NULL}; int count; - + /* sanity checks */ - if ELEM(NULL, obedit, arm) + if (ELEM(NULL, obedit, arm)) return OPERATOR_CANCELLED; - + /* loop over all bones, and only consider if visible */ CTX_DATA_BEGIN(C, EditBone *, ebone, visible_bones) { @@ -3041,7 +3040,7 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op) mul_v3_m4v3(curs, obedit->imat, give_cursor(scene, v3d)); /* Create a bone */ - newbone= add_points_bone(obedit, ebp->vec, curs); + /* newbone= */ add_points_bone(obedit, ebp->vec, curs); } else if (count == 2) { EditBonePoint *ebp, *ebp2; @@ -3102,7 +3101,7 @@ static int armature_fill_bones_exec (bContext *C, wmOperator *op) /* add new bone and parent it to the appropriate end */ if (headtail) { - newbone= add_points_bone(obedit, head, tail); + EditBone *newbone= add_points_bone(obedit, head, tail); /* do parenting (will need to set connected flag too) */ if (headtail == 2) { |