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/editors/sculpt_paint/paint_undo.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/editors/sculpt_paint/paint_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_undo.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c index ba0c2c8be92..345cda63f5a 100644 --- a/source/blender/editors/sculpt_paint/paint_undo.c +++ b/source/blender/editors/sculpt_paint/paint_undo.c @@ -34,6 +34,7 @@ #include "BLI_listbase.h" #include "BLI_utildefines.h" +#include "BLI_string.h" #include "DNA_userdef_types.h" @@ -106,7 +107,7 @@ static void undo_stack_push_begin(UndoStack *stack, const char *name, UndoRestor BLI_addtail(&stack->elems, uel); /* name can be a dynamic string */ - strncpy(uel->name, name, MAXUNDONAME-1); + BLI_strncpy(uel->name, name, sizeof(uel->name)); /* limit amount to the maximum amount*/ nr= 0; |