fix errors in code
authorCampbell Barton <ideasman42@gmail.com>
Sat, 13 Jul 2013 05:50:35 +0000 (05:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 13 Jul 2013 05:50:35 +0000 (05:50 +0000)
- 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
source/blender/blenkernel/intern/mball.c
source/blender/editors/space_clip/space_clip.c

index f47f86744afb956fc93d51d0c8110f2b773e2563..3ab1a8093bee6333a6f9bbb9288a768cf4675fa5 100644 (file)
@@ -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;
 
index 3ccf5038d8736e062ab88bc6cab066b8b46c0685..173b193b7527ff542c6e5f28fb8b11f5c2128f0c 100644 (file)
@@ -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) {
index 36cf9fc44c6969473446706b54956a101ecdc170..2cbb2373be8cbf94eb3cd8a3d79bb25efa3101d6 100644 (file)
@@ -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) {