diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-08-12 09:53:12 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-08-12 09:53:12 +0400 |
commit | d1085715a3b52bc31176a6accfa0b4838d99c2ab (patch) | |
tree | df9cc7bc84c5cb31e241c78d266a9c0b05f8461b /source/blender/blenkernel/intern/unit.c | |
parent | 23e057185370f1aaccf13f86062f3622d25e950a (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.c | 7 |
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 */ |