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/BCAnimationCurve.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/BCAnimationCurve.cpp')
-rw-r--r-- | source/blender/io/collada/BCAnimationCurve.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/io/collada/BCAnimationCurve.cpp b/source/blender/io/collada/BCAnimationCurve.cpp index 82d8b6e9ff3..005197c9027 100644 --- a/source/blender/io/collada/BCAnimationCurve.cpp +++ b/source/blender/io/collada/BCAnimationCurve.cpp @@ -173,10 +173,9 @@ std::string BCAnimationCurve::get_animation_name(Object *ob) const name = ""; } else { - char *boneName = BLI_str_quoted_substrN(fcurve->rna_path, "pose.bones["); - if (boneName) { + char boneName[MAXBONENAME]; + if (BLI_str_quoted_substr(fcurve->rna_path, "pose.bones[", boneName, sizeof(boneName))) { name = id_name(ob) + "_" + std::string(boneName); - MEM_freeN(boneName); } else { name = ""; |