Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Eicher <dan@eu.phorio.us>2012-06-09 02:05:26 +0400
committerDan Eicher <dan@eu.phorio.us>2012-06-09 02:05:26 +0400
commita8e0011c96c6bbf60e79911f870b25384e06f60d (patch)
tree949217ebe6e517c6c3c64dd8103e912ded029191 /source/blender/makesrna/intern/rna_sequencer_api.c
parent2f5612ba33d98ce45fcd76cd17975d7eeb0915b2 (diff)
rna_SequenceElements_pop --> use memcpy instead of strcpy
Diffstat (limited to 'source/blender/makesrna/intern/rna_sequencer_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_sequencer_api.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_sequencer_api.c b/source/blender/makesrna/intern/rna_sequencer_api.c
index e20435a07cd..3a534cd22b4 100644
--- a/source/blender/makesrna/intern/rna_sequencer_api.c
+++ b/source/blender/makesrna/intern/rna_sequencer_api.c
@@ -339,7 +339,6 @@ static StripElem *rna_SequenceElements_push(ID *id, Sequence *seq, const char *f
static void rna_SequenceElements_pop(ID *id, Sequence *seq, ReportList *reports, int index)
{
- int i;
Scene *scene = (Scene *)id;
StripElem *new_seq, *se;
@@ -361,12 +360,12 @@ static void rna_SequenceElements_pop(ID *id, Sequence *seq, ReportList *reports,
new_seq = MEM_callocN(sizeof(StripElem) * (seq->len - 1), "SequenceElements_pop");
seq->len--;
- /* TODO - simply use 2 memcpy calls */
- for (i = 0, se = seq->strip->stripdata; i < seq->len; i++, se++) {
- if (i == index)
- se++;
- BLI_strncpy(new_seq[i].name, se->name, sizeof(se->name));
- }
+ se = seq->strip->stripdata;
+ if (index > 0)
+ memcpy(new_seq, se, sizeof(StripElem) * index);
+
+ if (index < seq->len)
+ memcpy(&new_seq[index], &se[index + 1], sizeof(StripElem) * (seq->len - index));
MEM_freeN(seq->strip->stripdata);
seq->strip->stripdata = new_seq;