From fa3699f067fa18e1f1acd5c3aaaf4fb3cc4d8050 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 13 Jul 2013 05:50:35 +0000 Subject: fix errors in code - BKE_mball_center_median(), didn't work. - clip_refresh was removing handlers from wrong space. - new_modifier, replace strcpy with BLI_strncpy --- source/blender/blenkernel/intern/linestyle.c | 2 +- source/blender/blenkernel/intern/mball.c | 1 + source/blender/editors/space_clip/space_clip.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c index f47f86744af..3ab1a8093be 100644 --- a/source/blender/blenkernel/intern/linestyle.c +++ b/source/blender/blenkernel/intern/linestyle.c @@ -183,7 +183,7 @@ static LineStyleModifier *new_modifier(int type, size_t size) m = (LineStyleModifier *)MEM_callocN(size, "line style modifier"); m->type = type; - strcpy(m->name, modifier_name[type]); + BLI_strncpy(m->name, modifier_name[type], sizeof(m->name)); m->influence = 1.0f; m->flags = LS_MODIFIER_ENABLED | LS_MODIFIER_EXPANDED; diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 3ccf5038d87..173b193b752 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -2446,6 +2446,7 @@ bool BKE_mball_center_median(MetaBall *mb, float r_cent[3]) for (ml = mb->elems.first; ml; ml = ml->next) { add_v3_v3(r_cent, &ml->x); + total++; } if (total) { diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 36cf9fc44c6..2cbb2373be8 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -1019,7 +1019,7 @@ static void clip_refresh(const bContext *C, ScrArea *sa) if (ar_channels && !(ar_channels->flag & RGN_FLAG_HIDDEN)) { ar_channels->flag |= RGN_FLAG_HIDDEN; ar_channels->v2d.flag &= ~V2D_IS_INITIALISED; - WM_event_remove_handlers((bContext *)C, &ar_tools->handlers); + WM_event_remove_handlers((bContext *)C, &ar_channels->handlers); view_changed = TRUE; } if (ar_channels && ar_channels->alignment != RGN_ALIGN_NONE) { -- cgit v1.2.3