Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2007-01-19 23:33:00 +0300
committerTon Roosendaal <ton@blender.org>2007-01-19 23:33:00 +0300
commit4e03e83a53c60b397f7b727e2b9849a8b0f43a60 (patch)
treebba7a5d664a43fead53c53c6995bfbbbb644c946 /source/blender/src/usiblender.c
parent727ef00b6b4cb5b8a0dd503f73bc4f8ad7e4c963 (diff)
Bugfix #5664
Report had a very strange crash, which in the end appeared to be using a filename of 165 chars long. This gave two bugs; - the readBlog() function failed on that - even worse: the struct Global still stored it in G.sce with 160 chars! This is definitely an important issue... and (for the devs reading the 64 bits discussion) really not something allmighty coders are needed for! :)
Diffstat (limited to 'source/blender/src/usiblender.c')
-rw-r--r--source/blender/src/usiblender.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/src/usiblender.c b/source/blender/src/usiblender.c
index ab6b15a1ae2..725d8742892 100644
--- a/source/blender/src/usiblender.c
+++ b/source/blender/src/usiblender.c
@@ -555,7 +555,7 @@ static void free_openrecent(void)
static void readBlog(void)
{
- char name[FILE_MAXDIR+FILE_MAXFILE], filename[FILE_MAXFILE];
+ char name[FILE_MAX], filename[FILE_MAX];
LinkNode *l, *lines;
struct RecentFile *recent;
char *line;
@@ -570,11 +570,14 @@ static void readBlog(void)
for (l= lines, num= 0; l && (num<10); l= l->next, num++) {
line = l->link;
if (!BLI_streq(line, "")) {
- if (num==0) strcpy(G.sce, line);
+ if (num==0)
+ strcpy(G.sce, line);
+
recent = (RecentFile*)MEM_mallocN(sizeof(RecentFile),"RecentFile");
BLI_addtail(&(G.recent_files), recent);
recent->filename = (char*)MEM_mallocN(sizeof(char)*(strlen(line)+1), "name of file");
recent->filename[0] = '\0';
+
strcpy(recent->filename, line);
}
}