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:
authorCampbell Barton <ideasman42@gmail.com>2009-08-13 21:05:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-13 21:05:27 +0400
commit52a6a07d67f48c6c3465cbaf156bf8057755e1bc (patch)
treee10f280438fc1d2f14765bd918e54d3110d08ad8 /source/blender/editors/transform
parente8d9e0823ee73e3c3fdd596fd3945abec40d21c1 (diff)
added string max length option for unit functions bUnit_AsString and bUnit_ReplaceString
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 042e4a1941a..dd7cebdfe3f 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -3044,7 +3044,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) {
int i, do_split= t->scene->unit.flag & USER_UNIT_OPT_SPLIT ? 1:0;
for(i=0; i<3; i++)
- bUnit_AsString(&tvec[i*20], dvec[i]*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, do_split, 1);
+ bUnit_AsString(&tvec[i*20], 20, dvec[i]*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, do_split, 1);
}
else {
sprintf(&tvec[0], "%.4f", dvec[0]);
@@ -3054,7 +3054,7 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) {
}
if(t->scene->unit.system)
- bUnit_AsString(distvec, dist*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, t->scene->unit.flag & USER_UNIT_OPT_SPLIT, 0);
+ bUnit_AsString(distvec, sizeof(distvec), dist*t->scene->unit.scale_length, 4, t->scene->unit.system, B_UNIT_LENGTH, t->scene->unit.flag & USER_UNIT_OPT_SPLIT, 0);
else if( dist > 1e10 || dist < -1e10 ) /* prevent string buffer overflow */
sprintf(distvec, "%.4e", dist);
else