From d1085715a3b52bc31176a6accfa0b4838d99c2ab Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 12 Aug 2009 05:53:12 +0000 Subject: fix for errors evaluating user input when units are disabled --- source/blender/blenkernel/intern/unit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/unit.c') 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 */ -- cgit v1.2.3