diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-04 22:12:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-04 22:12:49 +0400 |
commit | 78d69a1e1598f9967738c6d2f3195e2540d274d0 (patch) | |
tree | 0e5e84792b1d00293054920683135ad4da07deef /source/blender/blenkernel/intern | |
parent | 41721e11fbf73812297b6945d0d6683eda400ba0 (diff) |
code cleanup: replace strcpy with BLI_strncpy for fixed size strings, and correct some harmless but incorrect sizeof() use
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sketch.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index b8d851d082a..ef1235c2b64 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -2080,6 +2080,8 @@ static void actcon_get_tarmat(bConstraint *con, bConstraintOb *cob, bConstraintT axis = data->type - 20; } + BLI_assert((unsigned int)axis < 3); + /* Target defines the animation */ s = (vec[axis] - data->min) / (data->max - data->min); CLAMP(s, 0, 1); diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c index 707d97a1cf1..bbd637a0a77 100644 --- a/source/blender/blenkernel/intern/sketch.c +++ b/source/blender/blenkernel/intern/sketch.c @@ -487,7 +487,7 @@ void sk_endContinuousStroke(SK_Stroke *stk) void sk_updateNextPoint(SK_Sketch *sketch, SK_Stroke *stk) { if (stk) { - memcpy(&sketch->next_point, stk->points[stk->nb_points - 1].p, sizeof(SK_Point)); + memcpy(&(sketch->next_point), &(stk->points[stk->nb_points - 1]), sizeof(SK_Point)); } } |