Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/property.c')
-rw-r--r--source/blender/blenkernel/intern/property.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c
index ec23a7db8a1..73f2a864e32 100644
--- a/source/blender/blenkernel/intern/property.c
+++ b/source/blender/blenkernel/intern/property.c
@@ -177,9 +177,9 @@ void BKE_bproperty_unique(bProperty *first, bProperty *prop, int force)
i = 0;
do { /* ensure we have enough chars for the new number in the name */
- BLI_snprintf(num, sizeof(num), "%d", i++);
- BLI_strncpy(new_name, base_name, sizeof(prop->name) - strlen(num));
- strcat(new_name, num);
+ const size_t num_len = BLI_snprintf(num, sizeof(num), "%d", i++);
+ BLI_snprintf(new_name, sizeof(prop->name),
+ "%.*s%s", (int)(sizeof(prop->name) - num_len), base_name, num);
} while (bproperty_get(first, prop, new_name));
BLI_strncpy(prop->name, new_name, sizeof(prop->name));