From 58587a38818b0dba25886c97d584285fef4e9249 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 Sep 2011 18:51:10 +0000 Subject: replace strncpy with BLI_strncpy, in some cases strncpy was being misused since it doesnt ensure \0 termination. also dont call CTX_data_scene() twice when checking for function arguments. --- source/blender/editors/space_sequencer/sequencer_select.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/space_sequencer/sequencer_select.c') diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index a6cc65017bb..c0919ef3043 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -169,11 +169,11 @@ static void UNUSED_FUNCTION(select_single_seq)(Scene *scene, Sequence *seq, int if((seq->type==SEQ_IMAGE) || (seq->type==SEQ_MOVIE)) { if(seq->strip) - strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR-1); + BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR); } else if(seq->type==SEQ_SOUND) { if(seq->strip) - strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR-1); + BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR); } seq->flag|= SELECT; recurs_sel_seq(seq); @@ -389,12 +389,12 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event) if ((seq->type == SEQ_IMAGE) || (seq->type == SEQ_MOVIE)) { if(seq->strip) { - strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR-1); + BLI_strncpy(ed->act_imagedir, seq->strip->dir, FILE_MAXDIR); } } else if (seq->type == SEQ_SOUND) { if(seq->strip) { - strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR-1); + BLI_strncpy(ed->act_sounddir, seq->strip->dir, FILE_MAXDIR); } } -- cgit v1.2.3