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/editors/transform/transform_orientations.c')
-rw-r--r--source/blender/editors/transform/transform_orientations.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c
index 0fa38e016ed..0e3dfad7107 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -146,7 +146,7 @@ TransformOrientation *createObjectSpace(bContext *C, ReportList *UNUSED(reports)
/* use object name if no name is given */
if (name[0] == 0)
{
- strncpy(name, ob->id.name+2, 35);
+ strncpy(name, ob->id.name+2, MAX_ID_NAME-2);
}
return addMatrixSpace(C, mat, name, overwrite);
@@ -290,7 +290,7 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[],
{
ts = MEM_callocN(sizeof(TransformOrientation), "UserTransSpace from matrix");
BLI_addtail(transform_spaces, ts);
- strncpy(ts->name, name, 35);
+ strncpy(ts->name, name, sizeof(ts->name));
}
/* copy matrix into transform space */
@@ -423,10 +423,11 @@ const char * BIF_menustringTransformOrientation(const bContext *C, const char *t
TransformOrientation *ts;
int i = V3D_MANIP_CUSTOM;
char *str_menu, *p;
+ const int elem_size = MAX_NAME + 4;
title = IFACE_(title);
- str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + 40 * BIF_countTransformOrientation(C), TIP_("UserTransSpace from matrix"));
+ str_menu = MEM_callocN(strlen(menu) + strlen(title) + 1 + elem_size * BIF_countTransformOrientation(C), TIP_("UserTransSpace from matrix"));
p = str_menu;
p += sprintf(str_menu, "%s", title);