From 5cf593a778e3dca51a5ebd6b4c23ce6c7b0a7ac6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Oct 2011 23:10:54 +0000 Subject: strcpy() --> BLI_strncpy(), where source strings are not fixed and target size is known. --- source/blender/editors/armature/editarmature.c | 6 +++--- source/blender/editors/armature/poselib.c | 9 +++------ 2 files changed, 6 insertions(+), 9 deletions(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 20368bbf57b..11fd932eed6 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -824,7 +824,7 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann } else if (strcmp(ct->subtarget, pchan->name)==0) { ct->tar = tarArm; - strcpy(ct->subtarget, curbone->name); + BLI_strncpy(ct->subtarget, curbone->name, sizeof(ct->subtarget)); } } } @@ -871,7 +871,7 @@ static void joined_armature_fix_links(Object *tarArm, Object *srcArm, bPoseChann } else if (strcmp(ct->subtarget, pchan->name)==0) { ct->tar = tarArm; - strcpy(ct->subtarget, curbone->name); + BLI_strncpy(ct->subtarget, curbone->name, sizeof(ct->subtarget)); } } } @@ -2503,7 +2503,7 @@ void updateDuplicateSubtargetObjects(EditBone *dupBone, ListBase *editbones, Obj */ if (oldtarget->temp) { newtarget = (EditBone *) oldtarget->temp; - strcpy(ct->subtarget, newtarget->name); + BLI_strncpy(ct->subtarget, newtarget->name, sizeof(ct->subtarget)); } } } diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index bf2e17c4e87..e7c7ebf3ece 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -997,11 +997,8 @@ static void poselib_preview_apply (bContext *C, wmOperator *op) } /* get marker name */ - if (pld->marker) - strcpy(markern, pld->marker->name); - else - strcpy(markern, "No Matches"); - + BLI_strncpy(markern, pld->marker ? pld->marker->name : "No Matches", sizeof(markern)); + sprintf(pld->headerstr, "PoseLib Previewing Pose: Filter - [%s] | Current Pose - \"%s\" | Use ScrollWheel or PageUp/Down to change", tempstr, markern); ED_area_headerprint(pld->sa, pld->headerstr); } @@ -1186,7 +1183,7 @@ static int poselib_preview_handle_event (bContext *UNUSED(C), wmOperator *op, wm /* backup stuff that needs to occur before every operation * - make a copy of searchstr, so that we know if cache needs to be rebuilt */ - strcpy(pld->searchold, pld->searchstr); + BLI_strncpy(pld->searchold, pld->searchstr, sizeof(pld->searchold)); /* if we're currently showing the original pose, only certain events are handled */ if (pld->flag & PL_PREVIEW_SHOWORIGINAL) { -- cgit v1.2.3