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>2010-11-05 10:35:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-05 10:35:21 +0300
commite179c92a278160ad3a1523a17ef272f6f3547f46 (patch)
tree743ba7ec0ac67b6afc202cdd7a5d063d6ee617ae /source/blender/editors/space_view3d/view3d_buttons.c
parent0ebdbdac00fda4ceb7f8a53e3b944575a8d76133 (diff)
tedious string copying changes
- use sizeof() in more places. - fixed some off by 1 bugs copying strings. setting curve font family for instance was 1 char too short. - replace strncpy and strcpy with BLI_strncpy
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_buttons.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 450b3725bdb..9d17bbfe7da 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -884,14 +884,14 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev)
{
EditBone *eBone= bonev;
- char oldname[32], newname[32];
-
+ char oldname[sizeof(eBone->name)], newname[sizeof(eBone->name)];
+
/* need to be on the stack */
- BLI_strncpy(newname, eBone->name, 32);
- BLI_strncpy(oldname, (char *)namev, 32);
+ BLI_strncpy(newname, eBone->name, sizeof(eBone->name));
+ BLI_strncpy(oldname, (char *)namev, sizeof(eBone->name));
/* restore */
- BLI_strncpy(eBone->name, oldname, 32);
-
+ BLI_strncpy(eBone->name, oldname, sizeof(eBone->name));
+
ED_armature_bone_rename(CTX_data_edit_object(C)->data, oldname, newname); // editarmature.c
WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, CTX_data_edit_object(C)); // XXX fix
}