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/modifiers/intern/MOD_displace.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/modifiers/intern/MOD_displace.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_displace.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index fb7aeacecc8..b0d9892a8df 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -40,6 +40,7 @@ #include "BLI_math.h" #include "BLI_utildefines.h" +#include "BLI_string.h" #include "BKE_cdderivedmesh.h" @@ -75,11 +76,11 @@ static void copyData(ModifierData *md, ModifierData *target) tdmd->texture = dmd->texture; tdmd->strength = dmd->strength; tdmd->direction = dmd->direction; - strncpy(tdmd->defgrp_name, dmd->defgrp_name, 32); + BLI_strncpy(tdmd->defgrp_name, dmd->defgrp_name, 32); tdmd->midlevel = dmd->midlevel; tdmd->texmapping = dmd->texmapping; tdmd->map_object = dmd->map_object; - strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32); + BLI_strncpy(tdmd->uvlayer_name, dmd->uvlayer_name, 32); } static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md) |