diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-15 02:08:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-15 02:08:56 +0400 |
commit | 9c8516703d24aa5e3f67d563c8f5dfd54592dc1d (patch) | |
tree | 54c013ed6f92050acbaecc8ceab22a898bcfb288 /source/blender/editors/transform/transform_orientations.c | |
parent | 1c2ff55334c774cdcf0699387de6e450cef38e99 (diff) |
replace strncpy with BLI_strncpy for cases we expect the string to be NULL terminated.
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 70e01ef3718..130e11d45aa 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -115,7 +115,7 @@ static TransformOrientation *createViewSpace(bContext *C, ReportList *UNUSED(rep View3D *v3d = CTX_wm_view3d(C); if (rv3d->persp == RV3D_CAMOB && v3d->camera) { /* If an object is used as camera, then this space is the same as object space! */ - strncpy(name, v3d->camera->id.name + 2, MAX_NAME); + BLI_strncpy(name, v3d->camera->id.name + 2, MAX_NAME); } else { strcpy(name, "Custom View"); @@ -141,7 +141,7 @@ static TransformOrientation *createObjectSpace(bContext *C, ReportList *UNUSED(r /* use object name if no name is given */ if (name[0] == 0) { - strncpy(name, ob->id.name + 2, MAX_ID_NAME - 2); + BLI_strncpy(name, ob->id.name + 2, MAX_ID_NAME - 2); } return addMatrixSpace(C, mat, name, overwrite); @@ -306,7 +306,7 @@ TransformOrientation *addMatrixSpace(bContext *C, float mat[3][3], char name[], if (ts == NULL) { ts = MEM_callocN(sizeof(TransformOrientation), "UserTransSpace from matrix"); BLI_addtail(transform_spaces, ts); - strncpy(ts->name, name, sizeof(ts->name)); + BLI_strncpy(ts->name, name, sizeof(ts->name)); } /* copy matrix into transform space */ |