diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-26 22:51:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-26 22:51:10 +0400 |
commit | 58587a38818b0dba25886c97d584285fef4e9249 (patch) | |
tree | 38e00681d39ee6a0f588232c9ef70ec5f80e22df /source/blender/blenkernel/intern/seqeffects.c | |
parent | e897c8e83e1277767d9a44cb0ecb6f8a279dddc3 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/seqeffects.c')
-rw-r--r-- | source/blender/blenkernel/intern/seqeffects.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index e5d74177c91..70b44792b30 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -41,6 +41,7 @@ #include "BLI_math.h" /* windows needs for M_PI */ #include "BLI_utildefines.h" +#include "BLI_string.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" @@ -177,7 +178,7 @@ static void open_plugin_seq(PluginSeq *pis, const char *seqname) MEM_freeN(info); cp= BLI_dynlib_find_symbol(pis->handle, "seqname"); - if(cp) strncpy(cp, seqname, 21); + if(cp) BLI_strncpy(cp, seqname, 21); } else { printf ("Plugin returned unrecognized version number\n"); return; @@ -203,7 +204,7 @@ static PluginSeq *add_plugin_seq(const char *str, const char *seqname) pis= MEM_callocN(sizeof(PluginSeq), "PluginSeq"); - strncpy(pis->name, str, FILE_MAXDIR+FILE_MAXFILE); + BLI_strncpy(pis->name, str, FILE_MAX); open_plugin_seq(pis, seqname); if(pis->doit==NULL) { |