diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-10 11:45:57 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-10 11:45:57 +0300 |
commit | e9c8e0316fbce2edfc9c2b6d0ddce18a3ea2a22a (patch) | |
tree | 1df10df2db106cd3e4c010463c44d4664a054204 /source | |
parent | 0372b642705c5304f252f7691b188fc65dd51b59 (diff) |
Some minor fixes from coverity reports.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_info/info_ops.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fd144c0ebc0..a8c868a6210 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -10025,7 +10025,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist) printf(" relative lib: %s\n", mainptr->curlib->name); printf(" enter a new path:\n"); - if (scanf("%s", newlib_path) > 0) { + if (scanf("%1023s", newlib_path) > 0) { /* Warning, keep length in sync with FILE_MAX! */ BLI_strncpy(mainptr->curlib->name, newlib_path, sizeof(mainptr->curlib->name)); BLI_strncpy(mainptr->curlib->filepath, newlib_path, sizeof(mainptr->curlib->filepath)); BLI_cleanup_path(G.main->name, mainptr->curlib->filepath); diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 1b0a52313ec..302d4da4b59 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1161,7 +1161,7 @@ static int gp_snap_cursor_to_sel(bContext *C, wmOperator *UNUSED(op)) } CTX_DATA_END; - if (v3d->around == V3D_AROUND_CENTER_MEAN) { + if (v3d->around == V3D_AROUND_CENTER_MEAN && count) { mul_v3_fl(centroid, 1.0f / (float)count); copy_v3_v3(cursor, centroid); } diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index ccd1b7cb029..121bf75c4a5 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1374,7 +1374,7 @@ int file_exec(bContext *C, wmOperator *exec_op) } else { BLI_cleanup_dir(G.main->name, sfile->params->dir); - strcat(sfile->params->dir, file->relpath); + strncat(sfile->params->dir, file->relpath, sizeof(sfile->params->dir)); BLI_add_slash(sfile->params->dir); } diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 2bcd56a3ced..771a64693e0 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -249,7 +249,7 @@ static int unpack_all_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED( } if (count == 1) - strcpy(title, IFACE_("Unpack 1 File")); + BLI_strncpy(title, IFACE_("Unpack 1 File"), sizeof(title)); else BLI_snprintf(title, sizeof(title), IFACE_("Unpack %d Files"), count); |