diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-12 03:52:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-12 03:52:45 +0400 |
commit | 4bfee0a1cf33f7b74f937ab991967f2047b80b9c (patch) | |
tree | de098504e2a0562093562919d99c49dafde5d39d /source/blender/editors/space_sequencer | |
parent | e3be5aacf8db45689ff03a9a1cf1b4e9f3e05fea (diff) |
fix [#28879] can't change names of some of the VSE strips
Multi-Cam, Sound, Movie and Image strips were not showing strip names.
also replace sprintf() with safer BLI_snprintf()
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 9e402de3b9d..8f1ea6fe254 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -511,47 +511,48 @@ static void draw_seq_text(View2D *v2d, Sequence *seq, float x1, float x2, float char str[32 + FILE_MAXDIR+FILE_MAXFILE]; const char *name= seq->name+2; char col[4]; - + + /* note, all strings should include 'name' */ if(name[0]=='\0') name= give_seqname(seq); if(seq->type == SEQ_META || seq->type == SEQ_ADJUSTMENT) { - sprintf(str, "%d | %s", seq->len, name); + BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name); } else if(seq->type == SEQ_SCENE) { if(seq->scene) { if(seq->scene_camera) { - sprintf(str, "%d | %s: %s (%s)", seq->len, name, seq->scene->id.name+2, ((ID *)seq->scene_camera)->name+2); + BLI_snprintf(str, sizeof(str), "%d | %s: %s (%s)", seq->len, name, seq->scene->id.name+2, ((ID *)seq->scene_camera)->name+2); } else { - sprintf(str, "%d | %s: %s", seq->len, name, seq->scene->id.name+2); + BLI_snprintf(str, sizeof(str), "%d | %s: %s", seq->len, name, seq->scene->id.name+2); } } else { - sprintf(str, "%d | %s", seq->len, name); + BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name); } } else if(seq->type == SEQ_MULTICAM) { - sprintf(str, "Cam: %d", seq->multicam_source); + BLI_snprintf(str, sizeof(str), "Cam | %s: %d", name, seq->multicam_source); } else if(seq->type == SEQ_IMAGE) { - sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name); + BLI_snprintf(str, sizeof(str), "%d | %s: %s%s", seq->len, name, seq->strip->dir, seq->strip->stripdata->name); } else if(seq->type & SEQ_EFFECT) { int can_float = (seq->type != SEQ_PLUGIN) || (seq->plugin && seq->plugin->version >= 4); if(seq->seq3!=seq->seq2 && seq->seq1!=seq->seq3) - sprintf(str, "%d | %s: %d>%d (use %d)%s", seq->len, name, seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!"); + BLI_snprintf(str, sizeof(str), "%d | %s: %d>%d (use %d)%s", seq->len, name, seq->seq1->machine, seq->seq2->machine, seq->seq3->machine, can_float ? "" : " No float, upgrade plugin!"); else if (seq->seq1 && seq->seq2) - sprintf(str, "%d | %s: %d>%d%s", seq->len, name, seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!"); + BLI_snprintf(str, sizeof(str), "%d | %s: %d>%d%s", seq->len, name, seq->seq1->machine, seq->seq2->machine, can_float ? "" : " No float, upgrade plugin!"); else - sprintf(str, "%d | %s", seq->len, name); + BLI_snprintf(str, sizeof(str), "%d | %s", seq->len, name); } else if (seq->type == SEQ_SOUND) { - sprintf(str, "%d | %s", seq->len, seq->sound->name); + BLI_snprintf(str, sizeof(str), "%d | %s: %s", seq->len, name, seq->sound->name); } else if (seq->type == SEQ_MOVIE) { - sprintf(str, "%d | %s%s", seq->len, seq->strip->dir, seq->strip->stripdata->name); + BLI_snprintf(str, sizeof(str), "%d | %s: %s%s", seq->len, name, seq->strip->dir, seq->strip->stripdata->name); } if(seq->flag & SELECT){ |