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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-01-16 03:13:12 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-01-16 03:13:12 +0400
commite0df491d1e465588cc018c6f6d00f72739b71516 (patch)
treefe4cbcdaa4633545bbc817c28eb780b551e5ac05 /source/blender/editors/transform/transform_orientations.c
parent76a211d80947a453f594e4cf0a1e0acc6786eddf (diff)
parent23806a2b7d50082d70a0e4ecab22aafb8433708a (diff)
Merged changes in the trunk up to revision 43404.
Conflicts resolved: source/blender/python/SConscript
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 3aa155fc8bb..8a9249f78e5 100644
--- a/source/blender/editors/transform/transform_orientations.c
+++ b/source/blender/editors/transform/transform_orientations.c
@@ -145,7 +145,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);
@@ -289,7 +289,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 */
@@ -422,10 +422,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);