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-12 09:53:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-12 09:53:12 +0400
commitd1085715a3b52bc31176a6accfa0b4838d99c2ab (patch)
treedf9cc7bc84c5cb31e241c78d266a9c0b05f8461b /source/blender/blenkernel/intern/unit.c
parent23e057185370f1aaccf13f86062f3622d25e950a (diff)
fix for errors evaluating user input when units are disabled
Diffstat (limited to 'source/blender/blenkernel/intern/unit.c')
-rw-r--r--source/blender/blenkernel/intern/unit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index 646b62b2d09..4a5e209a634 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -282,10 +282,13 @@ int bUnit_ReplaceString(char *str, char *str_orig, double scale_pref, int system
char str_tmp[256];
int change= 0;
- if(usys==NULL || usys->units[0].name==NULL)
+ strcpy(str, str_orig);
+
+ if(usys==NULL || usys->units[0].name==NULL) {
return 0;
+ }
- strcpy(str, str_orig);
+ scale_pref= 1.0/scale_pref;
for(unit= usys->units; unit->name; unit++) {
/* incase there are multiple instances */