diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-09-04 07:22:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-09-04 09:59:54 +0300 |
commit | e6194e735791b42feb51e810a4910a41d999d3bf (patch) | |
tree | 95889982ba8c6bc88f5bdfb2eded77159d81ca89 /source/blender/io/collada/BCAnimationSampler.cpp | |
parent | 716682365c6bcc1b5f757232ce1d2499b0d062a9 (diff) |
RNA: support extracting names from paths without allocating memory
Support extracting identifiers RNA paths into fixed size buffer
since the maximum size of the identifier is known all cases.
- Add BLI_str_unescape_ex to support limiting the destination buffer.
- Add BLI_str_quoted_substr to copy values into a fixed size buffer.
Diffstat (limited to 'source/blender/io/collada/BCAnimationSampler.cpp')
-rw-r--r-- | source/blender/io/collada/BCAnimationSampler.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/io/collada/BCAnimationSampler.cpp b/source/blender/io/collada/BCAnimationSampler.cpp index d2bde193c0a..953af5adffc 100644 --- a/source/blender/io/collada/BCAnimationSampler.cpp +++ b/source/blender/io/collada/BCAnimationSampler.cpp @@ -447,10 +447,9 @@ void BCAnimationSampler::initialize_curves(BCAnimationCurveMap &curves, Object * for (; fcu; fcu = fcu->next) { object_type = BC_ANIMATION_TYPE_OBJECT; if (ob->type == OB_ARMATURE) { - char *boneName = BLI_str_quoted_substrN(fcu->rna_path, "pose.bones["); - if (boneName) { + char boneName[MAXBONENAME]; + if (BLI_str_quoted_substr(fcu->rna_path, "pose.bones[", boneName, sizeof(boneName))) { object_type = BC_ANIMATION_TYPE_BONE; - MEM_freeN(boneName); } } |