diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2015-07-11 22:37:50 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2015-07-11 22:44:42 +0300 |
commit | 8c67b8ffe9fdab6698f20a39d5673b720e3d2756 (patch) | |
tree | 2e120012e02e2aa7d227c0f9bdb8a8c4eb00b205 /source/blender/editors/space_file/file_draw.c | |
parent | 7b1489b93bc6ff5b68ecee19132f1845a65983f0 (diff) |
File Browser: Fix possible bug and some minor tweaks
BLI_add_slash appended to a char *, a potential buffer overflow
Also partially removed an assert, which failed after changing file format of a saved image. We need a better way to handle such cases.
Diffstat (limited to 'source/blender/editors/space_file/file_draw.c')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 3c09800c310..9a5ec197797 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -160,16 +160,13 @@ void file_draw_buttons(const bContext *C, ARegion *ar) const struct direntry *file = sfile->files ? filelist_file(sfile->files, params->active_file) : NULL; int overwrite_alert = file_draw_check_exists(sfile); const bool is_active_dir = file && file->path && BLI_is_dir(file->path); - char *dir_path = (is_active_dir && params->active_file > 0) ? file->path : params->dir; - - BLI_add_slash(dir_path); /* callbacks for operator check functions */ UI_block_func_set(block, file_draw_check_cb, NULL, NULL); but = uiDefBut(block, UI_BTYPE_TEXT, -1, "", min_x, line1_y, line1_w - chan_offs, btn_h, - dir_path, 0.0, (float)FILE_MAX, 0, 0, + params->dir, 0.0, (float)FILE_MAX, 0, 0, TIP_("File path")); UI_but_func_complete_set(but, autocomplete_directory, NULL); UI_but_flag_enable(but, UI_BUT_NO_UTF8); |