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.
This commit is contained in:
2011-09-26 18:51:10 +00:00
parent e897c8e83e
commit 58587a3881
30 changed files with 79 additions and 68 deletions

View File

@@ -41,6 +41,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_string.h"
#include "BKE_action.h"
#include "BKE_cdderivedmesh.h"
@@ -72,8 +73,8 @@ static void copyData(ModifierData *md, ModifierData *target)
thmd->totindex = hmd->totindex;
thmd->indexar = MEM_dupallocN(hmd->indexar);
memcpy(thmd->parentinv, hmd->parentinv, sizeof(hmd->parentinv));
strncpy(thmd->name, hmd->name, 32);
strncpy(thmd->subtarget, hmd->subtarget, 32);
BLI_strncpy(thmd->name, hmd->name, 32);
BLI_strncpy(thmd->subtarget, hmd->subtarget, 32);
}
static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)