diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-12 19:54:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-12 19:54:24 +0300 |
commit | 55f68c36574779ae2fac3652466584628b22c633 (patch) | |
tree | e2f55301dda8897bf17f8b8459229d8fa5a67816 /source/blender/editors/animation | |
parent | 9eee1f962d49f14d92c8da4e677e4ee140f4f440 (diff) |
fix for more warnings.
- modifier code was using sizeof() without knowing the sizeof the array when clearing the modifier type array.
- use BLI_snprintf rather then sprintf where the size of the string is known.
- particle drawing code kept a reference to stack float values (not a problem at the moment but would crash if accessed later).
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 4a39534d566..7e9b52cd4e0 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -519,7 +519,7 @@ static int ed_marker_add(bContext *C, wmOperator *UNUSED(op)) marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker"); marker->flag= SELECT; marker->frame= frame; - sprintf(marker->name, "F_%02d", frame); // XXX - temp code only + BLI_snprintf(marker->name, sizeof(marker->name), "F_%02d", frame); // XXX - temp code only BLI_addtail(markers, marker); WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); @@ -747,19 +747,19 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) if (ELEM(mm->slink->spacetype, SPACE_TIME, SPACE_SOUND)) { SpaceTime *stime= (SpaceTime *)mm->slink; if (stime->flag & TIME_DRAWFRAMES) - sprintf(str, "Marker %d offset %d", selmarker->frame, offs); + BLI_snprintf(str, sizeof(str), "Marker %d offset %d", selmarker->frame, offs); else - sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs)); + BLI_snprintf(str, sizeof(str), "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs)); } else if (mm->slink->spacetype == SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)mm->slink; if (saction->flag & SACTION_DRAWTIME) - sprintf(str, "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs)); + BLI_snprintf(str, sizeof(str), "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs)); else - sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs)); + BLI_snprintf(str, sizeof(str), "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs)); } else { - sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs)); + BLI_snprintf(str, sizeof(str), "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs)); } } else { @@ -767,19 +767,19 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) if (ELEM(mm->slink->spacetype, SPACE_TIME, SPACE_SOUND)) { SpaceTime *stime= (SpaceTime *)mm->slink; if (stime->flag & TIME_DRAWFRAMES) - sprintf(str, "Marker offset %d ", offs); + BLI_snprintf(str, sizeof(str), "Marker offset %d ", offs); else - sprintf(str, "Marker offset %.2f ", FRA2TIME(offs)); + BLI_snprintf(str, sizeof(str), "Marker offset %.2f ", FRA2TIME(offs)); } else if (mm->slink->spacetype == SPACE_ACTION) { SpaceAction *saction= (SpaceAction *)mm->slink; if (saction->flag & SACTION_DRAWTIME) - sprintf(str, "Marker offset %.2f ", FRA2TIME(offs)); + BLI_snprintf(str, sizeof(str), "Marker offset %.2f ", FRA2TIME(offs)); else - sprintf(str, "Marker offset %.2f ", (double)(offs)); + BLI_snprintf(str, sizeof(str), "Marker offset %.2f ", (double)(offs)); } else { - sprintf(str, "Marker offset %.2f ", (double)(offs)); + BLI_snprintf(str, sizeof(str), "Marker offset %.2f ", (double)(offs)); } } @@ -802,7 +802,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt) ed_marker_move_apply(op); // ed_marker_header_update(C, op, str, (int)vec[0]); // strcat(str, str_tx); - sprintf(str, "Marker offset %s", str_tx); + BLI_snprintf(str, sizeof(str), "Marker offset %s", str_tx); ED_area_headerprint(CTX_wm_area(C), str); WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); |