From 0d355a8a2ccaeb54a1f723fd5adacec76d08c921 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 15 Sep 2011 12:26:48 +0000 Subject: replace BLI_strncpy with BLI_strncpy_utf8 where input isnt ensured to be valid. also replace strcpy's which copy using "" with str[0]='\0' --- source/blender/editors/armature/poselib.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 6e64d332cfd..67c93c4c906 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -1439,9 +1439,7 @@ static void poselib_preview_init_data (bContext *C, wmOperator *op) pld->pose->flag &= ~POSE_DO_UNLOCK; /* clear strings + search */ - strcpy(pld->headerstr, ""); - strcpy(pld->searchstr, ""); - strcpy(pld->searchold, ""); + pld->headerstr[0]= pld->searchstr[0]= pld->searchold[0]= '\0'; pld->search_cursor= 0; } -- cgit v1.2.3 From d4898f9c40dd008b14eab053864cd2b035652827 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Sep 2011 09:43:51 +0000 Subject: use macros RAD2DEG & DEG2RAD rather then multiplying by 180.0/M_PI or M_PI/180.0 --- source/blender/editors/armature/editarmature.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index a4b1e9a6e2c..eafe65b4492 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -361,7 +361,7 @@ static void fix_bonelist_roll (ListBase *bonelist, ListBase *editbonelist) print_m4("premat", premat); print_m4("postmat", postmat); print_m4("difmat", difmat); - printf ("Roll = %f\n", (-atan2(difmat[2][0], difmat[2][2]) * (180.0/M_PI))); + printf ("Roll = %f\n", RAD2DEGF(-atan2(difmat[2][0], difmat[2][2]))); #endif curBone->roll = (float)-atan2(difmat[2][0], difmat[2][2]); -- cgit v1.2.3