From 799e9c48c1a210386873ae01a0f208675eafffe7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 22 Jan 2011 03:50:09 +0000 Subject: comment dead code and fix 2 missing NULL checks (pointer used after NULL check and checking against incorrect pointer before use). --- source/blender/editors/armature/editarmature.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/armature') 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) { -- cgit v1.2.3