diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-11 22:50:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-11 22:50:07 +0300 |
commit | 5c8fc8e505fdfcd82e24dae75e7454b6f7d61530 (patch) | |
tree | e6101a8790effc2111985f20dc5ff73cbc443e89 /source/blender/editors/space_file | |
parent | 8c67b8ffe9fdab6698f20a39d5673b720e3d2756 (diff) |
Use const for direntry strings
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 9a5ec197797..be602e7330e 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -282,7 +282,7 @@ static int get_file_icon(struct direntry *file) return ICON_FILE_BLANK; } -static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, int width, int height, bool drag) +static void file_draw_icon(uiBlock *block, const char *path, int sx, int sy, int icon, int width, int height, bool drag) { uiBut *but; int x, y; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 4048c9fc1a1..3358812796e 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1252,8 +1252,9 @@ static void filelist_from_main(struct FileList *filelist) files->relname = BLI_strdup(id->name + 2); } else { - files->relname = MEM_mallocN(sizeof(*files->relname) * (FILE_MAX + (MAX_ID_NAME - 2)), __func__); - BLI_snprintf(files->relname, FILE_MAX + (MAX_ID_NAME - 2) + 3, "%s | %s", id->lib->name, id->name + 2); + char relname[FILE_MAX + (MAX_ID_NAME - 2) + 3]; + BLI_snprintf(relname, sizeof(relname), "%s | %s", id->lib->name, id->name + 2); + files->relname = BLI_strdup(relname); } files->type |= S_IFREG; #if 0 /* XXXXX TODO show the selection status of the objects */ |