diff options
author | Andrea Weikert <elubie@gmx.net> | 2007-02-09 01:43:32 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2007-02-09 01:43:32 +0300 |
commit | 95f462e3d07f2c1c8c0e4587cce450909c05c156 (patch) | |
tree | 2b0d595d4dec52efd0706a9d6f07d9ee27093b76 | |
parent | c02a71e21103db523f2955b1d6d172b418861449 (diff) |
==== icon themes ====
fix for potential issue with very long pathnames to the blender executable
-rw-r--r-- | source/blender/src/interface_icons.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/src/interface_icons.c b/source/blender/src/interface_icons.c index cf66931c9bf..e400ca9af74 100644 --- a/source/blender/src/interface_icons.c +++ b/source/blender/src/interface_icons.c @@ -583,9 +583,9 @@ static void init_iconfile_list(struct ListBase *list) int restoredir = 1; /* restore to current directory */ int totfile, i, index=1; int ifilex, ifiley; - char icondirstr[FILE_MAXDIR]; - char iconfilestr[FILE_MAXDIR+FILE_MAXFILE]; - char olddir[FILE_MAXDIR+FILE_MAXFILE]; + char icondirstr[FILE_MAX]; + char iconfilestr[FILE_MAX+16]; /* allow 256 chars for file+dir */ + char olddir[FILE_MAX]; list->first = list->last = NULL; @@ -613,6 +613,8 @@ static void init_iconfile_list(struct ListBase *list) if(BLI_testextensie(filename, ".png")) { /* check to see if the image is the right size, continue if not */ + /* copying strings here should go ok, assuming that we never get back + a complete path to file longer than 256 chars */ sprintf(iconfilestr, "%s/%s", icondirstr, filename); if(BLI_exists(iconfilestr)) bbuf = IMB_loadiffname(iconfilestr, IB_rect); |